Skip to content

Commit f376a12

Browse files
authored
fix: don't send keep-alive if we want reset (#1846)
1 parent c73e182 commit f376a12

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/client.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1395,7 +1395,7 @@ function write (client, request) {
13951395

13961396
if (upgrade) {
13971397
header += `connection: upgrade\r\nupgrade: ${upgrade}\r\n`
1398-
} else if (client[kPipelining]) {
1398+
} else if (client[kPipelining] && !socket[kReset]) {
13991399
header += 'connection: keep-alive\r\n'
14001400
} else {
14011401
header += 'connection: close\r\n'

test/proxy-agent.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ test('ProxyAgent correctly sends headers when using fetch - #1355, #1623', { ski
323323

324324
const expectedProxyHeaders = {
325325
host: `localhost:${proxy.address().port}`,
326-
connection: 'keep-alive'
326+
connection: 'close'
327327
}
328328

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

0 commit comments

Comments
 (0)