-
Notifications
You must be signed in to change notification settings - Fork 9.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
api_key
is not a good example for an HTTP header, because of the underscore
#3225
Labels
Milestone
Comments
Very interesting! Do you have time to raise a PR against the v3.1.1-dev branch? |
perrinjerome
added a commit
to perrinjerome/OpenAPI-Specification
that referenced
this issue
Apr 1, 2023
Several HTTP servers drop http headers with underscores. Fixes OAI#3225
Thanks ! I made a PR, please take a look |
perrinjerome
added a commit
to perrinjerome/swagger-petstore
that referenced
this issue
Apr 1, 2023
Headers with _ are stripped by some web servers. See also OAI/OpenAPI-Specification#3225
darrelmiller
pushed a commit
that referenced
this issue
Apr 13, 2023
Several HTTP servers drop http headers with underscores. Fixes #3225
charjr
pushed a commit
to charjr/OpenAPI-Specification
that referenced
this issue
Apr 27, 2023
Several HTTP servers drop http headers with underscores. Fixes OAI#3225
charjr
pushed a commit
to charjr/OpenAPI-Specification
that referenced
this issue
Apr 27, 2023
Several HTTP servers drop http headers with underscores. Fixes OAI#3225
handrews
added
the
examples
requests for more or better examples in the specification
label
Jan 27, 2024
PR was merged - closing, and thanks for fixing this! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Several HTTP servers strip HTTP headers when they contain
_
for security reasons. Using something likeapi-key
instead ofapi_key
in the examples would be a more realistic example.For references, nginx drops headers with underscores by default ( see https://nginx.org/en/docs/http/ngx_http_core_module.html#underscores_in_headers or https://dev.to/thesameeric/dont-use-underscores-in-your-http-headers-gfp ) django project's blog ( https://www.djangoproject.com/weblog/2015/jan/13/security/ ) has a good description of the problem. Other servers such as waitress ( Pylons/waitress#80 ) followed by dropping headers with underscore. I think apache http also drop such headers ( https://httpd.apache.org/docs/trunk/en/new_features_2_4.html#:~:text=Header%20names%20containing%20invalid%20characters%20(including%20underscores)%20are%20no%20longer%20converted%20to%20environment%20variables )
What I'm thinking is that in places where
api_key
is used to give an example of a header, for example inOpenAPI-Specification/versions/3.1.0.md
Lines 566 to 567 in 2408885
using something like
api-key
might be better.The text was updated successfully, but these errors were encountered: