Skip to content

Commit

Permalink
fixup: Update lib/remote.js
Browse files Browse the repository at this point in the history
  • Loading branch information
wraithgar authored Oct 16, 2024
1 parent 2c4d7f2 commit 344f7c7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/remote.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const RETRY_TYPES = [
// following redirects (through the cache if necessary)
// and verifying response integrity
const remoteFetch = (request, options) => {
// options.signal is intended for the fetch itself, not the agent. Attaching it to the agent will re-use that signal across multiple requests, which prevents any connections beyond the first one.
const agent = getAgent(request.url, { ...options, signal: undefined })
if (!request.headers.has('connection')) {
request.headers.set('connection', agent ? 'keep-alive' : 'close')
Expand Down

0 comments on commit 344f7c7

Please sign in to comment.