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

Fix Content-Length and Content-Type #226

Merged

Conversation

christianbundy
Copy link
Contributor

Problem: Both Content-Length and Content-Type are HTTP headers, but they aren't picked up by the request header fixer because they don't start with the usual HTTP_ prefix.

Solution: Add failing tests and then fix them by checking for either the usual HTTP_ prefix or comparing against the set of these two exceptional cases.

Fixes: #224

christianbundy and others added 6 commits September 16, 2022 15:40
Problem: Both Content-Length and Content-Type are HTTP headers, but they aren't
picked up by the request header fixer because they don't start with the usual
`HTTP_` prefix.

Solution: Add failing tests and then fix them by checking for either the usual
`HTTP_` prefix or comparing against the set of these two exceptional cases.

Fixes: adamchainz#224
@adamchainz adamchainz enabled auto-merge (squash) September 17, 2022 10:07
@adamchainz adamchainz merged commit b7a61cc into adamchainz:main Sep 17, 2022
@adamchainz
Copy link
Owner

Thank you! 👍 Needed a small bugfix with parentheses, you might want to check that out. I also added a changelog note - if you could try add that in your future open source contributions, that would save maintainers work.

@christianbundy
Copy link
Contributor Author

Ah, thanks for the paren bugfix -- I was just opening this PR to go fix that.

[...] changelog note [...]

Will do!

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.

request.headers.get("Content-Length") and request.headers.get("Content-Type")
2 participants