made mDNS query for paywall check more error resistant
This commit is contained in:
parent
95d5526f28
commit
6ba0cac3f3
|
@ -85,12 +85,8 @@ module.exports.create = function (deps, conf) {
|
|||
var dns = PromiseA.promisifyAll(require('dns'));
|
||||
var proms = testDomains.map(function (dom) {
|
||||
return dns.resolve6Async(dom)
|
||||
.catch(function (err) {
|
||||
if (err.code === 'ENODATA') {
|
||||
return dns.resolve4Async(dom);
|
||||
} else {
|
||||
return PromiseA.reject(err);
|
||||
}
|
||||
.catch(function () {
|
||||
return dns.resolve4Async(dom);
|
||||
})
|
||||
.then(function (result) {
|
||||
return result[0];
|
||||
|
|
Loading…
Reference in New Issue