From 4be35040d7078c908b20f014c9eb9975e74a1153 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Mon, 27 Aug 2018 19:58:50 +0200 Subject: [PATCH] fix(dnslink): could not resolve name (recursion limit exceeded) Context: https://github.com/ipfs/go-ipfs/issues/4293#issuecomment-416310364 --- add-on/src/lib/dnslink.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/add-on/src/lib/dnslink.js b/add-on/src/lib/dnslink.js index c1d7b1de9..7d8869e77 100644 --- a/add-on/src/lib/dnslink.js +++ b/add-on/src/lib/dnslink.js @@ -79,7 +79,7 @@ module.exports = function createDnslinkResolver (getState) { // js-ipfs-api does not provide method for fetching this // TODO: revisit after https://github.com/ipfs/js-ipfs-api/issues/501 is addressed // TODO: consider worst-case-scenario fallback to https://developers.google.com/speed/public-dns/docs/dns-over-https - const apiCall = `${apiProvider}api/v0/dns/${fqdn}` + const apiCall = `${apiProvider}api/v0/dns/${fqdn}?r=true` const xhr = new XMLHttpRequest() // older XHR API us used because window.fetch appends Origin which causes error 403 in go-ipfs // synchronous mode with small timeout // (it is okay, because we do it only once, then it is cached and read via readAndCacheDnslink) @@ -94,7 +94,7 @@ module.exports = function createDnslinkResolver (getState) { } return dnslink } else if (xhr.status === 500) { - // go-ipfs returns 500 if host has no dnslink + // go-ipfs returns 500 if host has no dnslink or an error occurred // TODO: find/fill an upstream bug to make this more intuitive return false } else {