Skip to content

Commit

Permalink
fix(dnslink): recover from HTTP timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
lidel committed Aug 27, 2018
1 parent 4be3504 commit d8dd8d7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion add-on/src/lib/ipfs-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ const { urlAtPublicGw } = require('./ipfs-path')
const redirectOptOutHint = 'x-ipfs-companion-no-redirect'
const recoverableErrors = new Set([
// Firefox
'NS_ERROR_NET_TIMEOUT', // eg. httpd is offline
'NS_ERROR_NET_RESET', // failed to load because the server kept reseting the connection
'NS_ERROR_NET_ON_RESOLVED', // no network
// Chrome
'net::ERR_CONNECTION_TIMED_OUT', // eg. httpd is offline
'net::ERR_INTERNET_DISCONNECTED' // no network
])

Expand Down Expand Up @@ -174,7 +176,7 @@ function createRequestModifier (getState, dnslinkResolver, ipfsPathValidator, ru

if (state.active) {
console.log('onErrorOccurred:' + request.error)
console.dir('onErrorOccurred', request)
console.log('onErrorOccurred', request)
// Check if error is final and can be recovered via DNSLink
const recoverableViaDnslink =
state.dnslinkPolicy &&
Expand Down

0 comments on commit d8dd8d7

Please sign in to comment.