Skip to content

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
@DemiMarie DemiMarie marked this pull request as draft April 21, 2025 07:06
@DemiMarie
Copy link
Author

I converted this to draft as it is missing tests.

@DemiMarie
Copy link
Author

This is an up-to-date version of #256, but without tests and without the more useful error messages.

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