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 lowercase HTTP/2 headers #2254

Open
pre opened this issue Mar 2, 2022 · 1 comment
Open

Allow lowercase HTTP/2 headers #2254

pre opened this issue Mar 2, 2022 · 1 comment

Comments

@pre
Copy link

pre commented Mar 2, 2022

HTTP/2 defines that HTTP headers be lowercase.

Grape consistently normalizes HTTP headers to PascalCase. This is ok since it's consistent.

However, there are more and more API clients which normalize HTTP headers to lowercase. One example is Axios.

This means that the exact same HTTP header name cannot be used as-is at the Grape API and Client side, since both implement a normalization of their own.

For example Rack provides Rack::Headers middleware which normalizes HTTP headers to lowercase per HTTP/2. It also seems the upcoming Rack 3 will provide lowercased HTTP headers by default.

I suggest an option to somehow enable HTTP header normalization to lowercase in Grape.

References:

@dblock
Copy link
Member

dblock commented Oct 21, 2023

See #2355 for a beginning of solving this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants