-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Should support upper-case headers #56
Comments
It is already case insensitive as Node.js HTTP lower cases them already. Try out the example at https://github.com/jshttp/type-is?tab=readme-ov-file#api and send upper case headers to see. |
That's true if you are using Node.js HTTP. We are using this in a project that does not use Node.js HTTP and has some clients that happen to send headers with upper-case characters. |
This project only works with Node.js HTTP. If you are using something else, you should be using something designed to work with whatever you are using instead. |
From the docs:
|
I'm sure you know this already, but |
Express uses Node.js HTTP. The Node.js does this because if you have a plan object like Perhaps you can provide a full Express.js app and show us a cURL request or similar with upper case headers that does not work. https://nodejs.org/api/http.html#messageheaders
|
Here's an issue from another project where they were seeing the exact same problem. I'm confident it's because their |
Then it wouldn't be the correct shape, as The reason Node.js sets all the keys to lower case is because in Javascript a key lookup is case sensitive and in order to accommodate case insensitive this module would have to look up every possible combination. And what is |
I've requested an enhancement to the other library to mimic the behavior of Node.js HTTP |
According to RFC 9110, I believe headers are meant to be case-insensitive.
Running the test suite in this project with a header of
Content-Type
yields errors. Would be nice to case-insensitively process those headers.I understand most clients will lower-case headers on the way out, but we have been using this in machine-to-machine APIs that don't always get lower-cased on the way out.
The text was updated successfully, but these errors were encountered: