We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0d53002 commit 2c37516Copy full SHA for 2c37516
lib/api.js
@@ -57,7 +57,7 @@ function isDnslinkPresent (fqdn) {
57
try {
58
xhr.send(null)
59
} catch (e) {
60
- return false
+ return null
61
}
62
if (xhr.status === 200) {
63
let json = JSON.parse(xhr.responseText)
@@ -71,9 +71,11 @@ function isDnslinkPresentCached (fqdn) {
71
let ipfsSupport = dnsCache.get(fqdn)
72
if (typeof ipfsSupport === 'undefined') {
73
ipfsSupport = isDnslinkPresent(fqdn)
74
- dnsCache.put(fqdn, ipfsSupport)
+ if (ipfsSupport !== null) { // dont cache is API was down
75
+ dnsCache.put(fqdn, ipfsSupport)
76
+ }
77
- return ipfsSupport
78
+ return !!ipfsSupport
79
80
81
exports.apiUrl = apiUrl
0 commit comments