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 option to allow spaces after header name for requests #3834

Open
SnehaGithub opened this issue Jan 17, 2025 · 0 comments
Open

Allow option to allow spaces after header name for requests #3834

SnehaGithub opened this issue Jan 17, 2025 · 0 comments
Labels
C-feature Category: feature. This is adding a new feature.

Comments

@SnehaGithub
Copy link

SnehaGithub commented Jan 17, 2025

Is your feature request related to a problem? Please describe.

Hi, we have a use case where parsing a request with a single space after header name is expected to succeed.

Currently, given a request with space after header name will fail parsing. Looks like because the space isn't a valid header token and the current allow_spaces_after_header_name check seems to be for responses only. Reference: seanmonstar/httparse#88

Describe the solution you'd like
Could we add an option for allow_spaces_after_header_name_in_requests check?

Effort:

  • adding an extra option allow_spaces_after_header_name_in_requests to ParserConfig in httparse
  • some modification to the parse function to ignore spaces after the header name if the config option is enabled in httparse
  • adding a wrapper function to hyper Builder impl for allowing spaces after header name

Describe alternatives you've considered
ignoring invalid headers and implementing a custom parser, but this is more complicated and inefficient to implement when we could just use an additional option here

Additional context
Add any other context or screenshots about the feature request here.

@SnehaGithub SnehaGithub added the C-feature Category: feature. This is adding a new feature. label Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature Category: feature. This is adding a new feature.
Projects
None yet
Development

No branches or pull requests

1 participant