diff options
Diffstat (limited to 'deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/index.js')
-rw-r--r-- | deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/index.js | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/index.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/index.js index f90a5297ca..4bc9704a10 100644 --- a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/index.js +++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/http-proxy-agent/index.js @@ -75,11 +75,9 @@ HttpProxyAgent.prototype.callback = function connect (req, opts, fn) { req.path = absolute; // inject the `Proxy-Authorization` header if necessary - if (proxy.auth) { - req.setHeader( - 'Proxy-Authorization', - 'Basic ' + Buffer.from(proxy.auth).toString('base64') - ); + var auth = proxy.auth; + if (auth) { + req.setHeader('Proxy-Authorization', 'Basic ' + new Buffer(auth).toString('base64')); } // create a socket connection to the proxy server |