Skip to content

Commit

Permalink
fix: don't send keep-alive if we want reset (nodejs#1846)
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag authored and crysmags committed Feb 27, 2024
1 parent 9b82548 commit 4624b04
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -1395,7 +1395,7 @@ function write (client, request) {

if (upgrade) {
header += `connection: upgrade\r\nupgrade: ${upgrade}\r\n`
} else if (client[kPipelining]) {
} else if (client[kPipelining] && !socket[kReset]) {
header += 'connection: keep-alive\r\n'
} else {
header += 'connection: close\r\n'
Expand Down
2 changes: 1 addition & 1 deletion test/proxy-agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ test('ProxyAgent correctly sends headers when using fetch - #1355, #1623', { ski

const expectedProxyHeaders = {
host: `localhost:${proxy.address().port}`,
connection: 'keep-alive'
connection: 'close'
}

proxy.on('connect', (req, res) => {
Expand Down

0 comments on commit 4624b04

Please sign in to comment.