-
Notifications
You must be signed in to change notification settings - Fork 16k
[Bug]: net.fetch fails on manual redirect #43715
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
Comments
This is working as documented, the request is cancelled if you don't call Ref: https://www.electronjs.org/docs/latest/api/client-request#event-redirect |
I see I'm trying use |
@MarshallOfSound this might be a bug in our Node.js fetch response also seems different from the spec, ref wpt tests https://github.com/web-platform-tests/wpt/blob/master/fetch/api/redirect/redirect-mode.any.js
|
Okay Node.js implementation was initially following the spec but it was later changed per nodejs/undici#1193. What should be the behavior we match in our |
For browsers opaque responses are needed for preventing xss attacks https://fetch.spec.whatwg.org/#atomic-http-redirect-handling. In Electron, users already can use Node.js fetch in these process to get those responses, so if we were to align net.fetch behavior we are not increasing the risk any higher. Also, the api is meant to offer easy migration for users from Node.js fetch to use chromium network stack, so aligning their behaviors would be better in this case. |
this also prevents (AFAIK) conditionally but completely intercepting http/s protocol by preventing the browser from following redirects. Appologies for the dumb question but Is anyone aware of an alternative solution to implement this currently using net.request (the issue here being a complete reproduction of the GlobalRequest to ClientRequest to listen for the 'redirect' event)?
|
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment! |
I have the same issue, is there any workaround ?? |
Same issue +1 |
4 similar comments
Same issue +1 |
Same issue +1 |
Same issue +1 |
Same issue +1 |
Preflight Checklist
Electron Version
30.4.0, 32.1.0
What operating system(s) are you using?
macOS
Operating System Version
Sonoma
What arch are you using?
arm64 (including Apple Silicon)
Last Known Working Electron version
unknown
Expected Behavior
using redirect: 'manual' net.fetch should return with the redirect response.
Actual Behavior
using redirect: 'manual' net.fetch fails with an 'Error: Redirect was cancelled'
Testcase Gist URL
https://gist.github.com/510aba6af66a8bbecf31682d8098cf25
Additional Information
No response
The text was updated successfully, but these errors were encountered: