-
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
XHR PUT/DELETE Requests on Electron Browser fail with Http Failure Response #2930
Comments
A bit more info.. I ran the Electron browser headed and was able to reproduce. This time, I got access to the developer console, and the error I'm seeing is:
This doesn't make sense, since I have CORS enabled and all of my API gateways, everything works in Chrome, and it's been working for ages. I double checked and the pre-flight OPTIONS request is indeed returning properly... screenshot: So the problem is, the Electron browser is not honoring the response from the pre-flight OPTIONS request the way Chrome is. Can't find anything on the web about what might be causing this.... any help appreciated. |
OK, I've done a bit more work and was able to identify the issue. I thought it was really weird that Electron accepted the CORS headers for GET/POST, but not PUT/DELETE. For giggles, I tried to delineate all of the CORS methods that were allowed, so I went to API Gateway and changed the CORS output from:
to
And lo and behold, everything works. Not sure why this is, but I'm going to leave this issue open in case you have additional insights/comments. |
Current behavior:
I have a set of tests that run against an Angular 7 application with no problem on the Chrome browser. This same set, however, fails when running on the Electron 59 browser. It's consistent and reproducible for me; upon further inspection, I noticed that all of the tests that fail do so when making PUT or DELETE requests to my back end REST API; POST requests function properly, and the tests that use them pass. So my "create" tests pass, whereas my "edit" and "delete" tests fail. The error screen:
You can see the error Http failure response for (unknown url): 0 Unknown Error
I turned on debugging and was unable to see anything in the XHDR outputs in the logs, and thus could not reproduce the problem.
Desired behavior:
Tests should run properly both in Electron 59 and in Chrome.
Steps to reproduce: (app code and test code)
If you'd like, I can add you to my application repo so you can run the failing test yourself. As I said, the challenge is that it only fails when running Electron; it behaves properly in Chrome. Reply with your username and I will give you access to the repo.
Versions
Cypress 3.1.3, Windows 10
Using API Gateway/Lambda for the backend, and CORS is properly configured.
The text was updated successfully, but these errors were encountered: