Skip to content
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

Opt-out from gateway redirects done by IPFS Companion #19

Merged
merged 2 commits into from
Sep 17, 2018

Conversation

lidel
Copy link
Member

@lidel lidel commented Jun 27, 2018

Our browser extension redirects request to gateways, which breaks this status page. Additionally, due to a workaround for CORS bug in Firefox it produces different results under Chrome and Firefox.

TL;DR we don't want browser extension to touch requests made by public-gateway-checker
This PR adds an explicit opt-out hint that ensures test requests reach the right gateway.

More info about opt-out URL hint: ipfs/ipfs-companion#505
(to be released with next version of browser extension)

cc @victorbjelkholm

@@ -27,7 +27,9 @@ function checkGateways (gateways) {
let checked = 0
gateways.forEach((gateway) => {
const gatewayAndHash = gateway.replace(':hash', hashToTest)
fetch(gatewayAndHash)
// opt-out from gateway redirects done by browser extension
const testUrl = gatewayAndHash + '#x-ipfs-companion-no-redirect'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@victorbjelkholm FYI this feature shipped to Beta in ipfs-companion/releases/tag/v2.4.0.10120

@lidel
Copy link
Member Author

lidel commented Jul 4, 2018

FYSA support for redirect opt-out via x-ipfs-companion-no-redirect shipped with v2.4.1 of our browser extension.

@victorb victorb merged commit 555d0de into ipfs:master Sep 17, 2018
@victorb
Copy link
Member

victorb commented Sep 17, 2018

Thanks!

@lidel lidel deleted the x-ipfs-no-redirect branch September 17, 2018 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants