Skip to content

Commit 6abbcc0

Browse files
committed
lib: fix Host header when CONNECT ProxyAgent
1 parent 6a04edc commit 6abbcc0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/proxy-agent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class ProxyAgent extends DispatcherBase {
9797
signal: opts.signal,
9898
headers: {
9999
...this[kProxyHeaders],
100-
host
100+
host: requestedHost,
101101
}
102102
})
103103
if (statusCode !== 200) {

test/proxy-agent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ test('ProxyAgent correctly sends headers when using fetch - #1355, #1623', async
393393
}
394394

395395
const expectedProxyHeaders = {
396-
host: `localhost:${proxy.address().port}`,
396+
host: `localhost:${server.address().port}`,
397397
connection: 'close'
398398
}
399399

0 commit comments

Comments
 (0)