forked from coolaj86/goldilocks.js
		
	preventing DNS lookup error from erroring the paywall detection
This commit is contained in:
		
							parent
							
								
									6ba0cac3f3
								
							
						
					
					
						commit
						f3beb4795f
					
				@ -79,7 +79,10 @@ module.exports.create = function (deps, conf) {
 | 
			
		||||
    // a paywall will either manipulate DNS queries to point to the paywall gate,
 | 
			
		||||
    // or redirect HTTP requests to the paywall gate. So we check for both and
 | 
			
		||||
    // hope we can detect most hotel/ISP paywalls out there in the world.
 | 
			
		||||
 | 
			
		||||
    //
 | 
			
		||||
    // It is also possible that the paywall will prevent any unknown traffic from
 | 
			
		||||
    // leaving the network, so the DNS queries could fail if the unit is set to
 | 
			
		||||
    // use nameservers other than the paywall router.
 | 
			
		||||
    return PromiseA.resolve()
 | 
			
		||||
    .then(function () {
 | 
			
		||||
      var dns = PromiseA.promisifyAll(require('dns'));
 | 
			
		||||
@ -90,6 +93,8 @@ module.exports.create = function (deps, conf) {
 | 
			
		||||
          })
 | 
			
		||||
          .then(function (result) {
 | 
			
		||||
            return result[0];
 | 
			
		||||
          }, function () {
 | 
			
		||||
            return null;
 | 
			
		||||
          });
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user