-
Notifications
You must be signed in to change notification settings - Fork 15k
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
The response of the CORS POST request is empty when using webRequest #20923
Comments
Just tried electron@7.1.0, the problem is still there. |
@vladimiry it looks like you're issuing the request from a page served on a custom domain, and additionally modifying the request with |
@nornagon that's correct, in the original repro repository a custom protocol is used but the problem is also reproducible for the regular/https scheme, the respective repro repo is here https://github.com/vladimiry-playground/electron-quick-start-cors-issue Notice that "access-control-allow-origin" header is shown defferently on dev console for 6.x and 7.x (it's related to the `Additional Information` section of the original message)
The expected value here is |
Your new repro also uses webRequest, so it seems like that's critical to this issue, yes? cc @zcbenz who worked on migrating webRequest to the network service. |
Correct, it's all about the onBeforeSendHeaders/onHeadersReceived webRequest handlers. |
@zcbenz it might be related to the OOR-CORS feature that was enabled https://groups.google.com/a/chromium.org/d/msg/network-service-dev/zph9qQsu91I/yE2-Pw8BAQAJ |
Currently webRequest in Electron uses the |
Can confirm the issue got resolved with 7.1.2 release. |
For me is not working on electron 7.1.2, on OSX, |
@jalanga did you try running the https://github.com/vladimiry-playground/electron-quick-start-cors-issue repo (initially provided here #20923 (comment))? If it works for you on OSX then the issue is probably in your code (1.7.12 => 7.1.2 is a major update that might require restructuring the exisitng code). |
@vladimiry Thank you for your time, your example is working, the headers are set, de single difference is that I do |
Fir parameter |
Preflight Checklist
Issue Details
The response of the CORS POST request is empty.
Expected Behavior
The response of the CORS POST request is not empty.
Actual Behavior
The response of the CORS POST request is empty.
To Reproduce
https://github.com/vladimiry-playground/electron-quick-start-custom-prtocol-cors-issue
Screenshots
Additional Information
In v7 and v8, the
access-control-allow-origin
andorigin
headers are not shown as modified in the dev console. It showshttps://mail.protonmail.com
value but should be showingscheme123://index.html
as v6 does.The text was updated successfully, but these errors were encountered: