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
X-<Header> converts to lowercase #228
Comments
Thanks for the report. The HTTP crate internally normalizes to lower case in order to implement a number of performance optimizations. As you quoted, the spec defines HTTP header fields as being case-insensitive. The It is possible for HTTP client and server implementations to add features supporting invalid HTTP peers without the I'm going to close this issue as there is no further action for us to take. |
As you've pointed out, RFC 7230 says names are case-insensitive, so should be perfectly valid to treat Notably, You could ask actix-web to provide such an option. |
With the following code:
Ok(HttpResponse::Ok() .header("X-Subject-Token", token.token) .body(""))
It transmits "X-Subject-Token" as "x-subject-token", this would seem to be a bug, it shouldn't be changing any header tags like this AFAIK?
Per RFC 7230, the headers should be case-insensitive, but I would still expect http to honor the case that I have provided.
RFC 7230
Note that the HTTP RFCs use camel-case with dash (-) separators when they describe the fields.
This is the first time that I have witnessed something like "content-type" instead of "Content-Type".
I would think that this might cause some compatibility issues with some http processors if they ignored section 3.2 (I ran into some code with that issue). So at the least, there should be an option to preserve Camel-Case if present IMO.
The text was updated successfully, but these errors were encountered: