You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This change builds on top of #783 and:
- adds support for recovery from DNS lookup failures
- enables recovery for all HTTP Codes >= 400
- recovers `.eth` DNS failures bu reopening website on EthDNS gateway at `.eth.link`
- simplifies some code paths and adds more tests
Motivation:
When a third-party IPFS gateway is discontinued or censored at DNS level, the IPFS Companion should retry request using currently active gateway set by the user (public or local).
We also want to recover in situation when website with DNSLink has a valid DNS `TXT` record, but HTTP behind `A` record is down or unreachable.
*Note*: right now the only real use for DNS recovery is support of .eth TLD via .eth.link gateway, however in the future this could provide means of working around DNS-based censorship (eg. by executing DNSLink lookups over libp2p as a fallback).
closes#678, closes#640
assert.ok(browser.tabs.create.withArgs({url: 'https://ipfs.io/ipfs/QmYbZgeWE7y8HXkH8zbb8J9ddHQvp8LTqm6isL791eo14h',active: true,openerTabId: 20}).calledOnce,'tabs.create should be called with IPFS default public gateway URL')
@@ -71,6 +76,7 @@ describe('requestHandler.onCompleted:', function () {
assert.ok(browser.tabs.create.withArgs({url: 'https://ipfs.io/ipfs/QmYbZgeWE7y8HXkH8zbb8J9ddHQvp8LTqm6isL791eo14h',active: true,openerTabId: 20}).calledOnce,'tabs.create should be called with IPFS default public gateway URL')
140
148
})
149
+
it('should recover from unreachable HTTP server by reopening DNSLink on the public gateway',asyncfunction(){
assert.ok(browser.tabs.create.withArgs({url: expectedUrl,active: true,openerTabId: 20}).calledOnce,'tabs.create should be called with ENS resource on local gateway URL')
156
+
dnslinkResolver.clearCache()
157
+
})
158
+
it('should recover from failed DNS for .eth opening it on EthDNS gateway at .eth.link',asyncfunction(){
assert.ok(browser.tabs.create.withArgs({url: expectedUrl,active: true,openerTabId: 20}).calledOnce,'tabs.create should be called with ENS resource on local gateway URL')
0 commit comments