Comparing version 0.3.5 to 0.3.6
@@ -9,3 +9,4 @@ var http = require("http"), | ||
CookieJar = require("./cookiejar").CookieJar, | ||
encodinglib = require("encoding"); | ||
encodinglib = require("encoding"), | ||
net = require("net"); | ||
@@ -237,3 +238,3 @@ exports.FetchStream = FetchStream; | ||
if (this.options.asyncDnsLoookup) { | ||
var dnsCallback = (function (err, adresses){ | ||
var dnsCallback = (function (err, addresses){ | ||
if (err) { | ||
@@ -245,3 +246,3 @@ this.emit("error", err); | ||
url_data.urloptions.headers['host'] = url_data.urloptions.hostname || url_data.urloptions.host; | ||
url_data.urloptions.hostname = adresses[0]; | ||
url_data.urloptions.hostname = addresses[0]; | ||
url_data.urloptions.host = url_data.urloptions.headers['host'] + (url_data.urloptions.port? ':' + url_data.urloptions.port: ''); | ||
@@ -252,3 +253,7 @@ | ||
dns.resolve4(url_data.urloptions.host, dnsCallback); | ||
if(net.isIP(url_data.urloptions.host)){ | ||
dnsCallback(null, [url_data.urloptions.host]); | ||
}else{ | ||
dns.resolve4(url_data.urloptions.host, dnsCallback); | ||
} | ||
} else { | ||
@@ -255,0 +260,0 @@ this._runStream(url_data, url); |
{ | ||
"name": "fetch", | ||
"description": "Fetch URL contents", | ||
"version": "0.3.5", | ||
"version": "0.3.6", | ||
"author": "Andris Reinman", | ||
@@ -6,0 +6,0 @@ "maintainers": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27221
570
8