Skip to content

Commit fd46fa9

Browse files
committed
fix: test
1 parent 4beaafd commit fd46fa9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

test/proxy-agent.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const Pool = require('../lib/dispatcher/pool')
99
const { createServer } = require('node:http')
1010
const https = require('node:https')
1111
const { createProxy } = require('proxy')
12+
const nodeMajorVersion = Number(process.versions.node.split('.')[0])
1213

1314
const certs = (() => {
1415
const forge = require('node-forge')
@@ -832,7 +833,8 @@ test('Proxy via HTTP to HTTP endpoint with tunneling disabled', async (t) => {
832833
const json = await data.body.json()
833834
t.deepStrictEqual(json, {
834835
host: `localhost:${server.address().port}`,
835-
connection: 'keep-alive'
836+
// Mismatch on behaviour between 18 and upwards
837+
connection: nodeMajorVersion > 18 ? 'keep-alive' : 'close'
836838
})
837839

838840
server.close()

0 commit comments

Comments
 (0)