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

Change hard-coded headernames to lowercase #386

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

Conversation

halvko
Copy link
Contributor

@halvko halvko commented Oct 30, 2021

The change at line 114 in src/security/mod.rs corrects a logic error, the rest is at best a small optimization and at worst a style choice

Copy link
Member

@yoshuawuyts yoshuawuyts left a comment

Choose a reason for hiding this comment

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

I'm not sure I understand what issue this solves? Header names should be case-agnostic. And since we're only ever encoding values here, if an error occurs it seems like the issue would be in a parser, not in any of the encoders?

I feel like I'm missing something?

@halvko
Copy link
Contributor Author

halvko commented Jan 25, 2022

As I understand it, headers are not case agnostic for HTTP/2 connections “However, header field names MUST be converted to lowercase prior to their encoding in HTTP/2” (https://httpwg.org/specs/rfc7540.html#HttpHeaders).

@halvko
Copy link
Contributor Author

halvko commented Jan 25, 2022

And the documentation for ‘HeaderName::from_lowercase_str’ specifically states that the input is expected to be lowercase

@halvko halvko requested a review from yoshuawuyts June 16, 2022 09:46
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

2 participants