Skip to content
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

Allow underscores on headers #19

Merged
merged 1 commit into from Apr 19, 2022
Merged

Conversation

ted-marozzi
Copy link
Contributor

  • fix spelling mistakes
  • fix a header not being tested
  • allow underscores on headers

Underscores are allowed in headers according to the http spec: https://stackoverflow.com/questions/22856136/why-do-http-servers-forbid-underscores-in-http-header-names.

Ran into this problem with code I am writing for a to be production server. The code throws no warnings and just silently removes the _'s leaving cors to fail the request.

* fix spelling mistakes
* fix a header not being tested
@ted-marozzi
Copy link
Contributor Author

Fixes #14

Copy link
Contributor

@VojtechVitek VojtechVitek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks legit.

rs/cors#103 allows dot (.) as well.

@ted-marozzi
Copy link
Contributor Author

@VojtechVitek Happy to add the . but will do it in a separate pull request if this gets merged

@pkieltyka pkieltyka merged commit 318c905 into go-chi:master Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants