From bc22aa576527b8cbb42e0ac5abef46724ddde467 Mon Sep 17 00:00:00 2001 From: Luke Nimtz Date: Mon, 29 Aug 2022 13:59:45 -0700 Subject: [PATCH] ProxyAgent passing correct host headers to proxy, fixes #1623 --- lib/proxy-agent.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/proxy-agent.js b/lib/proxy-agent.js index bfc75d796ed..c281dbbb599 100644 --- a/lib/proxy-agent.js +++ b/lib/proxy-agent.js @@ -38,7 +38,7 @@ class ProxyAgent extends DispatcherBase { this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}` } - const { origin, port } = new URL(opts.uri) + const { origin, port, host } = new URL(opts.uri) const connect = buildConnector({ ...opts.proxyTls }) this[kConnectEndpoint] = buildConnector({ ...opts.requestTls }) @@ -58,7 +58,7 @@ class ProxyAgent extends DispatcherBase { signal: opts.signal, headers: { ...this[kProxyHeaders], - host: opts.host + host } }) if (statusCode !== 200) {