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

Block leading and trailing whitespace in field values #760

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DemiMarie
Copy link

This blocks header values with leading and trailing whitespace. This is not needed for HTTP/1.x where the parser already strips such whitespace, but in HTTP/2 and HTTP/3 the parser does not strip such whitespace and so it is up to the http crate to reject such headers.

Different HTTP/2 and HTTP/3 libraries treat such values differently, so rejection is the safest option.

Fixes #245

This blocks header values with leading and trailing whitespace.
This is not needed for HTTP/1.x where the parser already strips
such whitespace, but in HTTP/2 and HTTP/3 the parser does not
strip such whitespace and so it is up to the `http` crate to reject
such headers.

Different HTTP/2 and HTTP/3 libraries treat such values
differently, so rejection is the safest option.

Fixes hyperium#245
@DemiMarie DemiMarie marked this pull request as ready for review March 26, 2025 19:56
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.

Remove trailing whitespaces from header values
1 participant