I have an issue with a CORS request. The problem is that it's not at all consistent, sometimes it works with no issues, sometimes it only works on Chrome, and sometimes not at all.
But the most frequent way it manifests itself is that the OPTIONS preflight request passes without any issues, but the actual request, a POST request, is canceled by the browser. The Origin header in the request matches the Access-Control-Allow-Origin header in the preflight response.
The errors I get in the console are:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:... . (Reason: CORS request did not succeed).
SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Access is denied.
If I make the request "manually", using "Edit and Resend" from the Firefox Network tab, it works without any issue.
Also, some other times the OPTIONS preflight request is canceled by the browser without any changes being made to the server code or the client code.
User contributions licensed under CC BY-SA 3.0