Headers change from original case to all lowercase during cy.request()
See original GitHub issueCurrent behavior:
I use the “Authorization” header to authenticate a request but when I post a html form in cypress it changes all the HTTP headers to lowercase, so “Authorization” becomes “authorization” which is refused at backend.
so this is my browser
this is cypress

Desired behavior:
I’d like the request headers to keep their capital letter because it causes issues😋
Steps to reproduce:
Make a small php file with a html form, and when submit print_r(getallheaders());
Versions
Cypress V3.1.2 NodeJS v8.11.4 Npm v6.4.1
I use Chrome v70.0.3538.110 on MacOS Mojave v10.14.1
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:12 (5 by maintainers)
Top Results From Across the Web
fetch() sends lower case header keys - Stack Overflow
When I look at the request in the Electron Newtork panel, the request headers are present but Authorization has become authorization . I...
Read more >Headers are getting convert into lower case? | Layer7 API ...
I tried MESSAGE_ID and MESSAGE_TYPE which is being converted in lowercase as i log all request headers in API gateway.
Read more >request - Cypress Documentation
cy.request() yields the response as an object literal containing properties such as: status; body; headers ...
Read more >Request and response objects - Django documentation
A case insensitive, dict-like object that provides access to all HTTP-prefixed headers (plus Content-Length and Content-Type ) from the request.
Read more >Configure custom rules language attributes - Google Cloud
A string-to-string map of the HTTP request headers. If a header contains multiple values, the value in this map would be a comma-separated...
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

The http spec specifies that headers should be case insensitive, as such we’re closing this issue.
Hey @Robpizza, the HTTP spec does define header fields as case insensitive - so servers should be case insensitive as well.
But, I understand that not all servers may choose to behave in this way. I don’t think it would be unreasonable to pass along the Header fields with the casings as they were originally requested, but as you said, I’m not sure how this is implemented.