make-fetch-happen
Advanced tools
Comparing version 2.4.5 to 2.4.6
29
agent.js
@@ -37,3 +37,3 @@ 'use strict' | ||
if (pxuri) { | ||
const proxy = getProxy(pxuri, parsedUri, opts) | ||
const proxy = getProxy(pxuri, opts, isHttps) | ||
AGENT_CACHE.set(key, proxy) | ||
@@ -124,3 +124,3 @@ return proxy | ||
let SocksProxyAgent | ||
function getProxy (proxyUrl, destUrl, opts) { | ||
function getProxy (proxyUrl, opts, isHttps) { | ||
let popts = { | ||
@@ -139,17 +139,18 @@ host: proxyUrl.hostname, | ||
if (destUrl.protocol === 'http:') { | ||
if (!HttpProxyAgent) { | ||
HttpProxyAgent = require('http-proxy-agent') | ||
} | ||
if (proxyUrl.protocol === 'http:' || proxyUrl.protocol === 'https:') { | ||
if (!isHttps) { | ||
if (!HttpProxyAgent) { | ||
HttpProxyAgent = require('http-proxy-agent') | ||
} | ||
return new HttpProxyAgent(popts) | ||
} | ||
if (destUrl.protocol === 'https:') { | ||
if (!HttpsProxyAgent) { | ||
HttpsProxyAgent = require('https-proxy-agent') | ||
return new HttpProxyAgent(popts) | ||
} else { | ||
if (!HttpsProxyAgent) { | ||
HttpsProxyAgent = require('https-proxy-agent') | ||
} | ||
return new HttpsProxyAgent(popts) | ||
} | ||
return new HttpsProxyAgent(popts) | ||
} | ||
if (proxyUrl.startsWith('socks')) { | ||
if (proxyUrl.protocol.startsWith('socks')) { | ||
if (!SocksProxyAgent) { | ||
@@ -156,0 +157,0 @@ SocksProxyAgent = require('socks-proxy-agent') |
@@ -5,2 +5,14 @@ # Change Log | ||
<a name="2.4.6"></a> | ||
## [2.4.6](https://github.com/zkat/make-fetch-happen/compare/v2.4.5...v2.4.6) (2017-05-24) | ||
### Bug Fixes | ||
* **proxy:** choose agent for http(s)-proxy by protocol of destUrl ([ea4832a](https://github.com/zkat/make-fetch-happen/commit/ea4832a)) | ||
* **proxy:** make socks proxy working ([1de810a](https://github.com/zkat/make-fetch-happen/commit/1de810a)) | ||
* **proxy:** revert previous proxy solution ([563b0d8](https://github.com/zkat/make-fetch-happen/commit/563b0d8)) | ||
<a name="2.4.5"></a> | ||
@@ -7,0 +19,0 @@ ## [2.4.5](https://github.com/zkat/make-fetch-happen/compare/v2.4.4...v2.4.5) (2017-05-24) |
{ | ||
"name": "make-fetch-happen", | ||
"version": "2.4.5", | ||
"version": "2.4.6", | ||
"description": "Opinionated, caching, retrying fetch client", | ||
@@ -5,0 +5,0 @@ "main": "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
58506
783