Skip to content

Commit

Permalink
ProxyAgent passing correct host headers to proxy, fixes nodejs#1623
Browse files Browse the repository at this point in the history
  • Loading branch information
protometa committed Aug 29, 2022
1 parent 9256df5 commit bc22aa5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/proxy-agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
Expand All @@ -58,7 +58,7 @@ class ProxyAgent extends DispatcherBase {
signal: opts.signal,
headers: {
...this[kProxyHeaders],
host: opts.host
host
}
})
if (statusCode !== 200) {
Expand Down

0 comments on commit bc22aa5

Please sign in to comment.