made mDNS query for paywall check more error resistant

This commit is contained in:
tigerbot 2017-07-14 17:04:24 -06:00
parent 95d5526f28
commit 6ba0cac3f3
1 changed files with 2 additions and 6 deletions

View File

@ -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') {
.catch(function () {
return dns.resolve4Async(dom);
} else {
return PromiseA.reject(err);
}
})
.then(function (result) {
return result[0];