cacheable-lookup
Advanced tools
Comparing version 6.0.2 to 6.0.3
{ | ||
"name": "cacheable-lookup", | ||
"version": "6.0.2", | ||
"version": "6.0.3", | ||
"description": "A cacheable dns.lookup(…) that respects TTL", | ||
@@ -5,0 +5,0 @@ "engines": { |
@@ -283,16 +283,23 @@ 'use strict'; | ||
async _lookup(hostname) { | ||
const [A, AAAA] = await Promise.all([ | ||
// Passing {all: true} doesn't return all IPv4 and IPv6 entries. | ||
// See https://github.com/szmarczak/cacheable-lookup/issues/42 | ||
ignoreNoResultErrors(this._dnsLookup(hostname, all4)), | ||
ignoreNoResultErrors(this._dnsLookup(hostname, all6)) | ||
]); | ||
try { | ||
const [A, AAAA] = await Promise.all([ | ||
// Passing {all: true} doesn't return all IPv4 and IPv6 entries. | ||
// See https://github.com/szmarczak/cacheable-lookup/issues/42 | ||
ignoreNoResultErrors(this._dnsLookup(hostname, all4)), | ||
ignoreNoResultErrors(this._dnsLookup(hostname, all6)) | ||
]); | ||
return { | ||
entries: [ | ||
...A, | ||
...AAAA | ||
], | ||
cacheTtl: 0 | ||
}; | ||
return { | ||
entries: [ | ||
...A, | ||
...AAAA | ||
], | ||
cacheTtl: 0 | ||
}; | ||
} catch { | ||
return { | ||
entries: [], | ||
cacheTtl: 0 | ||
}; | ||
} | ||
} | ||
@@ -299,0 +306,0 @@ |
24406
482