Why should we do toLowerCase to header name (by normalizeName()) ?
See original GitHub issueCode first:
fetch( url, {
headers:{
'Cookie':'some key-value pass to server',
'User-Agent': 'react-native Android'
}
);
I found that the name of headers has been converted to lower case by normalizeName .
And when I use it on React-Native (Android platform) , it send a HTTP request with lower case header name which not be recognized in our Server.
There is the row HTTP text I’ve capture:
GET http://... HTTP/1.1
cookie: ...
user-agent: react-native Android
So. Why should we do toLowerCase to header name ?
Issue Analytics
- State:
- Created 8 years ago
- Reactions:7
- Comments:16 (2 by maintainers)
Top Results From Across the Web
How to prevent of converting header name into lower case
I am adding custom headers to my response and Spring boot doesn't convert headers to lowercase in my case. Have you checked response...
Read more >com.liferay.portal.kernel.util.StringUtil.toLowerCase java code ...
Returns true if the strings are equal, ignoring case. trim. Trims leading and trailing whitespace from the string, up to but not including...
Read more >Name normalization - Relativity Documentation
Name normalization analyzes email document headers to identify all aliases, such as proper names, email addresses, and more, and the entities, ...
Read more >String.prototype.toLowerCase() - JavaScript - MDN Web Docs
The toLowerCase() method returns the value of the string converted to lower case. toLowerCase() does not affect the value of the string str ......
Read more >falcon.response — Falcon 3.1.1 documentation
Note: Falcon will encode the given text as UTF-8 in the response. ... where we need more control over setting # headers and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

While Http headers should be case-insensitive, a server for a client we’re dealing with has miss implemented the spec. They check authorization header using equality it seems and accordingly produce an error.
We do not have control over modifying the code of that server, we can submit a request but that will take time to process.
If according to the spec the header should be case-insensitive I don’t see why forcing the headers to be lower case matters then, we should be generally allowed to send headers in any case form.
@kobvel That’s correct.