bagofrequest
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -1,2 +0,5 @@ | ||
### 0.1.3-pre | ||
### 0.1.4 | ||
* Add noproxy environment variable support | ||
### 0.1.3 | ||
* Set min node engine to v4.0.0 | ||
@@ -3,0 +6,0 @@ |
@@ -204,3 +204,11 @@ var request = require('request'), | ||
const NO_PROXY_HOSTS = ['localhost', '127.0.0.1']; | ||
return (opts.noProxyHosts || NO_PROXY_HOSTS).indexOf(_url.parse(url).hostname) !== -1; | ||
var noProxyHosts = []; | ||
if (process.env.no_proxy) { | ||
noProxyHosts = noProxyHosts.concat(process.env.no_proxy.split(',')); | ||
} | ||
if (process.env.NO_PROXY) { | ||
noProxyHosts = noProxyHosts.concat(process.env.NO_PROXY.split(',')); | ||
} | ||
noProxyHosts = noProxyHosts.concat(NO_PROXY_HOSTS); | ||
return (opts.noProxyHosts || noProxyHosts).indexOf(_url.parse(url).hostname) !== -1; | ||
} | ||
@@ -207,0 +215,0 @@ |
@@ -8,3 +8,3 @@ { | ||
], | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"homepage": "http://github.com/cliffano/bagofrequest", | ||
@@ -45,2 +45,2 @@ "author": "Cliffano Subagio <blah@cliffano.com> (http://blog.cliffano.com)", | ||
] | ||
} | ||
} |
@@ -14,3 +14,3 @@ <img align="right" src="https://raw.github.com/cliffano/bagofrequest/master/avatar.jpg" alt="Avatar"/> | ||
bagofrequest#request | ||
bagofrequest#request | ||
@@ -38,2 +38,3 @@ Send http request using [mikeal/request](http://github.com/mikeal/request), with the following additional features: | ||
* if URL is not provided, then set proxy to http_proxy or HTTP_PROXY, otherwise fallback to https_proxy or HTTPS_PROXY | ||
* proxy will be ignored if host is on no_proxy or NO_PROXY when provided, otherwise ignore 127.0.0.1 and localhost | ||
@@ -103,3 +104,3 @@ Installation | ||
retry: { | ||
errorCodes: true, // retry on any error | ||
errorCodes: true, // retry on any error | ||
statusCodes: [404, 503], // retry when response status code is 404 or 503 | ||
@@ -106,0 +107,0 @@ scale: 0.5, // increase delay by half on each retry |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances 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
15477
189
142
14