make-fetch-happen
Advanced tools
Comparing version 9.0.0 to 9.0.1
@@ -7,4 +7,4 @@ 'use strict' | ||
const AGENT_CACHE = new LRU({ max: 50 }) | ||
let HttpsAgent | ||
let HttpAgent | ||
const HttpAgent = require('agentkeepalive') | ||
const HttpsAgent = HttpAgent.HttpsAgent | ||
@@ -70,7 +70,2 @@ module.exports = getAgent | ||
if (!HttpsAgent) { | ||
HttpAgent = require('agentkeepalive') | ||
HttpsAgent = HttpAgent.HttpsAgent | ||
} | ||
const agent = isHttps ? new HttpsAgent({ | ||
@@ -160,4 +155,4 @@ maxSockets: agentMaxSockets, | ||
const getAuth = u => | ||
u.username && u.password ? `${u.username}:${u.password}` | ||
: u.username ? u.username | ||
u.username && u.password ? decodeURIComponent(`${u.username}:${u.password}`) | ||
: u.username ? decodeURIComponent(u.username) | ||
: null | ||
@@ -167,5 +162,5 @@ | ||
let HttpProxyAgent | ||
let HttpsProxyAgent | ||
let SocksProxyAgent | ||
const HttpProxyAgent = require('http-proxy-agent') | ||
const HttpsProxyAgent = require('https-proxy-agent') | ||
const SocksProxyAgent = require('socks-proxy-agent') | ||
module.exports.getProxy = getProxy | ||
@@ -189,19 +184,9 @@ function getProxy (proxyUrl, opts, isHttps) { | ||
if (proxyUrl.protocol === 'http:' || proxyUrl.protocol === 'https:') { | ||
if (!isHttps) { | ||
if (!HttpProxyAgent) | ||
HttpProxyAgent = require('http-proxy-agent') | ||
if (!isHttps) | ||
return new HttpProxyAgent(popts) | ||
} else { | ||
if (!HttpsProxyAgent) | ||
HttpsProxyAgent = require('https-proxy-agent') | ||
else | ||
return new HttpsProxyAgent(popts) | ||
} | ||
} else if (proxyUrl.protocol.startsWith('socks')) { | ||
if (!SocksProxyAgent) | ||
SocksProxyAgent = require('socks-proxy-agent') | ||
} else if (proxyUrl.protocol.startsWith('socks')) | ||
return new SocksProxyAgent(popts) | ||
} else { | ||
else { | ||
throw Object.assign( | ||
@@ -208,0 +193,0 @@ new Error(`unsupported proxy protocol: '${proxyUrl.protocol}'`), |
{ | ||
"name": "make-fetch-happen", | ||
"version": "9.0.0", | ||
"version": "9.0.1", | ||
"description": "Opinionated, caching, retrying fetch client", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
12
55616
968