-
Notifications
You must be signed in to change notification settings - Fork 324
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
Do not redirect XHR that would fail due to CORS bug in Firefox #494
Conversation
HTTP HEAD is often used for preloading data at arbitrary gateways. It should arrive at original destination, no matter what hostname is used.
Since this is a severe limitation on what single page applications on ipfs will be able to do in for example an offline situation I think logging a warning every time this happens is a good idea. I think both firefox and chrome provide ways to silence those logs if the are expected. |
If we use the In combination with the log line, the altered behaviour in Firefox remains visible and the restriction can be removed easily when the issue is fixed. Meanwhile by leaving in the functionality for Chrome you ensure the code that is doing it continues to work as expected. |
@alanshaw I initially did that, but got worried about providing different redirect rules for different vendors, which feels like a bad developer experience. So your suggestion is to limit this workaround to Firefox only and and be very explicit that it is a temporary workaround for an upstream bug limited to Firefox? |
This implements suggestions from: #494 (comment) Wider context: #494
Alright, switched this PR to apply the workaround only when in Firefox runtime. |
Fix delivered to Beta in #494 looks stable enough to be promoted to Stable This PR: - synchronizes locales with [crowdin](https://crowdin.com/project/ipfs-companion) - bumps version in preparation to stable release
For anyone interested in this fix, it just got shipped to stable channel as v2.3.1 |
This change removes woraround introduced in PR #494 and restores redirect in onBeforeRequest. The original bug was fixed in Firefox 69, that is why we also bump minimal version. More info at: #436 (comment)
This change removes woraround introduced in PR #494 and restores redirect in onBeforeRequest. The original bug was fixed in Firefox 69, that is why we also bump minimal version. More info at: #436 (comment)
This change removes workaround introduced in PR #494 and restores redirect in onBeforeRequest. The original bug was fixed in Firefox 69, that is why we also bump minimal version. More info at: #436 (comment)
This PR disables gateway redirect for cross-origin XHRs.
Samples
Examples of sites broken in v2.3.0 by the bug:
(open Console to see CORS error)
Open Questions
I'd appreciate some quick feedback, before this gets merged and released: