-
Notifications
You must be signed in to change notification settings - Fork 32
headers converted to lowercase #63
Comments
Thank you @spiderworm for reporting. I will look for good practice, then I will fix this if needed. |
Hi there, Because of the same forcing-of-lowercase issue I believe. https://www.edsm.net/api-commander-v1/get-ranks?commandername=ethzero |
It looks to be more related to the Node.js platform. I will dig into it to see if some options can be set to remove this automatic lowercase transforming. |
But FYI, servers should not be case sensitive when dealing with headers. |
I made some research. Unfortunately, Node.js low-level client lower-case every headers keys. It cannot be fixed without complex development. |
In my situation, the lower-case headers did not cause an issue on the server. The real issue I had was caused by Chrome's Developer Tools, which has trouble showing POST data apparently when the header is 'content-type' rather than 'Content-Type', so this is something that Google can fix. Regardless, I do hope Node changes this behavior at some point, because I still do not think that it should be mucking around with the header names I provide. |
I've noticed that adding headers to requests using request-json clientside (perhaps via node as well) causes the headers name to be converted to lowercase, i.e. adding the following header:
{ Authorization:
Bearer ${token}
}... results in the following header:
authorization: Bearer ${token}
Not sure if this is an issue with services, but it's disconcerting that request-json appears to be modifying my headers.
The text was updated successfully, but these errors were encountered: