-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Errors from (fault)net::ERR_EMPTY_RESPONSE and TypeError [ERR_INVALID_HTTP_TOKEN]: Internal error during proxy #28865
Comments
@francllinrios Cypress has a proxy that pulls all the headers off of the requests and resets them (if needed). This erroring is surfacing that there is an invalid HTTP header since this error is being thrown when we set it from Node's https://www.geeksforgeeks.org/node-js-http-validateheadername-method/ If this is your website: That being said, Cypress should handle this better. Perhaps we should validate that the HTTP headers are correct before resetting them? Or just catch and ignore and errors that are thrown here? Probably second option makes more sense. /~https://github.com/cypress-io/cypress/blob/fix-flake-on-launchpad-ui/packages/proxy/lib/http/response-middleware.ts#L332 |
@jennifer-shehane Hi! After some time spent reproducing the bug i managed to do it. I can make cypress raise the error with the visit command but the request command still goes through and I'm still trying to understand why. As to the solution, i followed your suggestion and just ignored the error but shouldn't cypress inform that the header is invalid? Maybe give some type of warning in the console? I'm interested in creating a PR to fix this. |
@BernardoSousa03 Yah, we should handle this better I think. |
…ypress-io#28865 When receiving the described HTTP response Cypress might reset the headers of the response. This would cause the validateHeaderName method from node to be called which would cause an error, since the headers where invalid. Now Crypress verifies all the headers before reseting them, discards invalid ones and sends a warning in the console when debug module is on.
…o#28865 When receiving the described HTTP response Cypress might reset the headers of the response. This would cause the validateHeaderName method from node to be called which would cause an error, since the headers were invalid. Now Crypress verifies all the headers before reseting them, discards invalid ones and sends a warning in the console when debug module is on.
…o#28865 When receiving the described HTTP response Cypress resets the headers. This would cause the validateHeaderName method from node to be called which would cause an error, since the headers were invalid. Now Crypress verifies all the headers before reseting them, discards invalid ones and sends a warning in the console when debug module is on.
…o#28865 When receiving the described HTTP response Cypress resets the headers. This would cause the validateHeaderName method from node to be called which would cause an error, since the headers where invalid. Now Crypress verifies all the headers before reseting them, discards invalid ones and sends a warning in the console when debug module is on.
…o#28865 When receiving the described HTTP response Cypress resets the headers. This would cause the validateHeaderName method from node to be called which would cause an error, since the headers where invalid. Now Crypress verifies all the headers before reseting them, discards invalid ones and sends a warning in the console when debug module is on.
…29420) * fix: HTTP response with invalid headers doesn't throw error #28865 When receiving the described HTTP response Cypress resets the headers. This would cause the validateHeaderName method from node to be called which would cause an error, since the headers where invalid. Now Crypress verifies all the headers before reseting them, discards invalid ones and sends a warning in the console when debug module is on. * fix: improved warning display to the command line When cutting off invalid headers from the response the user is informed of such headers in the command line * fix: added undefined verification and catched missing error Fixed a typescript error where validateHeaderValue was being called with value possibly being undefined. Fixed catching missing error where code is 'ERROR_INVALID_CHAR' and rethrows other errors * Update cli/CHANGELOG.md --------- Co-authored-by: Jennifer Shehane <jennifer@cypress.io> Co-authored-by: Cacie Prins <cacieprins@users.noreply.github.com> Co-authored-by: Bill Glesias <bglesias@gmail.com>
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior
When I run my automation it returns an unknown error. and only in the Cypress browser on Chrome or any other it gives this error, if I log in outside of the browser that Cypress opens it opens the normal application screen.
ERROR:
Desired behavior
You should be able to return to the login scenario without showing this error and should open the normal screen as shown in the image.
Test code to reproduce
Cypress Version
13.6.4
Node version
v18.16.0
Operating System
macOS e ubuntu 23.10
Debug Logs
Other
No response
The text was updated successfully, but these errors were encountered: