Skip to content

Conversation

@andrei-21
Copy link
Contributor

Since reqwest downcases header names:

Header names are normalized to lower case. In other words, when
creating a HeaderName with a string, even if upper case characters are
included, when getting a string representation of the HeaderName, it
will be all lower case. This allows for faster HeaderMap comparison
operations.

https://docs.rs/reqwest/latest/reqwest/header/index.html#headername

Since reqwest downcases header names:

> Header names are normalized to lower case. In other words, when
> creating a HeaderName with a string, even if upper case characters are
> included, when getting a string representation of the HeaderName, it
> will be all lower case. This allows for faster HeaderMap comparison
> operations.

https://docs.rs/reqwest/latest/reqwest/header/index.html#headername
@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Jan 19, 2026

I've assigned @tankyleo as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

Copy link
Contributor

@tankyleo tankyleo left a comment

Choose a reason for hiding this comment

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

TIL thank you ! Let's also do the same in the JWT implementation

let auth_header = headers_map
.get("Authorization")
.iter()
.find_map(
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm rather than iterating over all the headers here, I think we can safely make the assumption that all the keys will be lowercased, and do get("authorization") directly. WDYT ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Since the Authorizer trait is internal to vss-server, I think we should do this, and add a quick doc in the Authorizer trait definition along the lines of "implementations can assume all header names to be lower case"

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.

3 participants