From ed62b57922ac653803abbc86efea5ede411f25d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Sat, 1 Apr 2017 01:05:09 -0700 Subject: [PATCH] fix(agent): nudge around things with opts.agent --- index.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/index.js b/index.js index c0d54d0..d4918df 100644 --- a/index.js +++ b/index.js @@ -183,7 +183,7 @@ function setWarning (reqOrRes, code, message, host) { function remoteFetch (uri, opts) { const agent = getAgent(uri, opts) const headers = { - 'connection': agent != null ? 'keep-alive' : 'close', + 'connection': agent ? 'keep-alive' : 'close', 'user-agent': `${pkg.name}/${pkg.version} (+https://npm.im/${pkg.name})` } if (opts.headers) { @@ -265,8 +265,6 @@ function getAgent (uri, opts) { return https.globalAgent } else if (url.parse(uri).protocol === 'http:') { return http.globalAgent - } else { - return null } }