From b82801659bec67519ef370a7a4d800c11dd23961 Mon Sep 17 00:00:00 2001 From: Gopal Date: Sat, 29 Aug 2026 13:33:44 +0400 Subject: [PATCH 1/2] test: introduce prototype mismatch issue in proxy-agent test --- test/proxy-agent.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/proxy-agent.js b/test/proxy-agent.js index c4d04b08d09..bc5c444e6f0 100644 --- a/test/proxy-agent.js +++ b/test/proxy-agent.js @@ -1041,7 +1041,7 @@ test('ProxyAgent correctly sends headers when using fetch - #1355, #1623 (with p after(() => setGlobalDispatcher(defaultDispatcher)) - const expectedHeaders = { + const expectedHeaders = Object.assign(Object.create(null), { host: `localhost:${server.address().port}`, connection: 'keep-alive', 'test-header': 'value', @@ -1050,13 +1050,13 @@ test('ProxyAgent correctly sends headers when using fetch - #1355, #1623 (with p 'sec-fetch-mode': 'cors', 'user-agent': 'undici', 'accept-encoding': 'gzip, deflate' - } + }) - const expectedProxyHeaders = { + const expectedProxyHeaders = Object.assign(Object.create(null), { 'proxy-connection': 'keep-alive', host: `localhost:${server.address().port}`, connection: 'close' - } + }) proxy.on('connect', (req, res) => { t.deepStrictEqual(req.headers, expectedProxyHeaders) From ae015f327b6fed967a3ea3530a3fe61add461fe4 Mon Sep 17 00:00:00 2001 From: Gopal Date: Sat, 29 Aug 2026 13:33:54 +0400 Subject: [PATCH 2/2] fix: normalize object prototype in proxy-agent test (#5671) fix: normalize object prototype in proxy-agent test What Problem This Solves: nightly test fails due to prototype mismatch in deepStrictEqual comparison Why This Change Was Made: Object.create(null) and plain object literals have different prototypes, causing strict equality to fail even when structure is identical User Impact: Fixes failing nightly test suite Evidence: test/proxy-agent.js now passes --- test/proxy-agent.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/proxy-agent.js b/test/proxy-agent.js index bc5c444e6f0..c4d04b08d09 100644 --- a/test/proxy-agent.js +++ b/test/proxy-agent.js @@ -1041,7 +1041,7 @@ test('ProxyAgent correctly sends headers when using fetch - #1355, #1623 (with p after(() => setGlobalDispatcher(defaultDispatcher)) - const expectedHeaders = Object.assign(Object.create(null), { + const expectedHeaders = { host: `localhost:${server.address().port}`, connection: 'keep-alive', 'test-header': 'value', @@ -1050,13 +1050,13 @@ test('ProxyAgent correctly sends headers when using fetch - #1355, #1623 (with p 'sec-fetch-mode': 'cors', 'user-agent': 'undici', 'accept-encoding': 'gzip, deflate' - }) + } - const expectedProxyHeaders = Object.assign(Object.create(null), { + const expectedProxyHeaders = { 'proxy-connection': 'keep-alive', host: `localhost:${server.address().port}`, connection: 'close' - }) + } proxy.on('connect', (req, res) => { t.deepStrictEqual(req.headers, expectedProxyHeaders)