Skip to content
This repository has been archived by the owner on Jun 12, 2022. It is now read-only.

Commit

Permalink
fix(agent): nudge around things with opts.agent
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Apr 1, 2017
1 parent f50e9df commit ed62b57
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -265,8 +265,6 @@ function getAgent (uri, opts) {
return https.globalAgent
} else if (url.parse(uri).protocol === 'http:') {
return http.globalAgent
} else {
return null
}
}

Expand Down

0 comments on commit ed62b57

Please sign in to comment.