-
-
Notifications
You must be signed in to change notification settings - Fork 174
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
Use case insensitive headers #57
Comments
Yo! So this only matches case-sensitive for the headers you manually provide into the last argument. This is done as I most commonly saw Express developers use capitalized forms in their applications. Once the helper reaches these two places: polka/packages/send-type/index.js Line 10 in a9f0f58
polka/packages/send-type/index.js Line 26 in a9f0f58
... Node automatically lowercases any/all keys it received. |
Yeah and I happen to be a portion of them who using everything lowercase in all kind of headers.
It took me quite a while to figure this out until I look at the code. Any plan to resolve this? |
Hey @motss, sorry for the delay on this. This will be working for you in the next release 😄 I just lowercased any/all header keys that were passed into |
LGTM! Really appreciate the fix. |
What cat I do if I need to send response with uppercase letters ? |
You should use It still reads your header values without caring about case, but it will write output headers with capital casing. You should also fix/report an issue with your HTTP client, because it's supposed to not matter |
Line 11 in d0c3863
Makes header key lowercase. |
Line 30 in d0c3863
|
I'm not talking about the content type, I have a problem with custom headers like |
Ah sorry, you didn't specify. Then I wouldn't include them inside the |
Yes, this is an option, but it would be better if |
Sorry, I'm really not inclined to support this. I don't want to lock in/promise vanity behavior that shouldn't be there in the first place. Forces Polka to continue that (almost) indefinitely when, again, the HTTP spec says it's not supposed to matter. |
Ок, anyway thanks for reply and cool lib :) |
polka/packages/send-type/index.js
Line 3 in a9f0f58
According to https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2, HTTP headers are case insensitive. Thus, it should also handle
'content-type'
.The text was updated successfully, but these errors were encountered: