-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Headers change from original case to all lowercase during cy.request() #2879
Comments
I tried it in NodeJS + Express and the headers are all converted to lowercase but when I request rawHeaders they are normal. Request headers
Raw headers
|
Does Cypress use HTTP in NodeJS to send requests? |
bump |
We changed our back-end 👍 |
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. |
Cypress currently transforms all headers to be lowercase when testing using |
Hey @nhhockeyplayer, please see our main documentation here: https://docs.cypress.io Cypress is a front end testing tool built for the modern web. We address the key pain points developers and QA engineers face when testing modern applications. TypeScript doc: https://on.cypress.io/typescript-support |
@nhhockeyplayer I'm sorry, I don't understand completely. What is happening that you want to stop happening? Where are you seeing behavior from Cypress exactly? |
Hello, I am also experiencing this issue but with cy.route where the response headers are being transformed to lowercase and modifying them. The following is the same semantics they use; casing and hyphens. This format is odd but I do not have control over changing the server that provides the response. Would there be any work around here?
is changed to
Cypress version is 4.12.1 |
I can confirm it's happening with the Authorization header. |
Any chances to make "headers converting" an option that could be set in cypress options? |
The http spec specifies that headers should be case insensitive, as such we're closing this issue.
|
Current 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
The text was updated successfully, but these errors were encountered: