-
Notifications
You must be signed in to change notification settings - Fork 3.4k
fix(unify): Do not crash when an ill formed URL request is proxied #19186
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
fix(unify): Do not crash when an ill formed URL request is proxied #19186
Conversation
|
Thanks for taking the time to open a PR!
|
Test summaryRun details
View run in Cypress Dashboard ➡️ Failures
Flakiness
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
||||||||||||||||||||||||||||||||||||||||||||||
flotwig
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fix is good, but could you also add some error handling around the addContext call itself? It shouldn't crash the process if it fails. In fact, I don't really see why the promise chain isn't catching the error, is it an unhandled rejection or is there no .on('error' handler on the HTTPS server so this error crashes the process?
|
@flotwig I have made the requested changes |
flotwig
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Very nice 👍
User facing changelog
The Cypress App will no longer crash when proxying an ill formed request. For example, if the application under test has a resource of "http: //localhost/asset.js" (notice the extraneous space) the Cypress App will no longer crash. Instead, a debug message will be logged and the asset will fail to load.
Additional details
The goal here is to treat these ill-formed requests just like any other requests that are problematic (e.g. not found resources). Thus, we don't attempt to stop the tests outright, but instead just fail the individual request.
How has the user experience changed?
Before:
Terminal:
After:
Terminal:
Browser Console:
Network:
PR Tasks
cypress-documentation?type definitions?cypress.schema.json?