get-url-proxy
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "get-url-proxy", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "get-url-proxy will return the applicable proxy to use for a given URL based on NO_PROXY and PROT_PROXY environment variables", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
var normalizeProtocols = require('./normalize-protocols'); | ||
var proxies = require('./proxy-list'); | ||
@@ -7,11 +8,8 @@ module.exports = function getProxyForProtocol(protocol) { | ||
for (var i=0; i<prots.length; i++) { | ||
var prot = prots[i]; | ||
if (process.env[prot + '_PROXY']) { | ||
return process.env[prot + '_PROXY']; | ||
var proxy = proxies[prots[i]]; | ||
if (proxy) { | ||
return proxy; | ||
} | ||
if (process.env[prot.toLowerCase() + '_proxy']) { | ||
return process.env[prot.toLowerCase() + '_proxy']; | ||
} | ||
} | ||
return null; | ||
}; |
@@ -34,3 +34,3 @@ # node-get-url-proxy | ||
* `HTTP` -> [`HTTP`. `HTTPS`] | ||
* `HTTP` -> [`HTTP`, `HTTPS`] | ||
* `HTTPS` -> [`HTTPS`, `HTTP`] | ||
@@ -37,0 +37,0 @@ * `WS` -> [`WS`, `WSS`, `HTTPS`, `HTTP`] |
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
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 1 instance in 1 package
5146
8
55
0