1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Fix IPv6 missing brackets in httpProxy.ServerOptions (#5914)

This commit is contained in:
Dominic1DL 2022-08-30 14:17:51 +02:00 committed by Sebastian Malton
parent 2c0702fb43
commit 4d5fe399fc

View File

@ -155,6 +155,12 @@ export class ContextHandler implements ClusterContextHandler {
if (this.clusterUrl.hostname) {
headers.Host = this.clusterUrl.hostname;
// fix current IPv6 inconsistency in url.Parse() and httpProxy.
// with url.Parse the IPv6 Hostname has no Square brackets but httpProxy needs the Square brackets to work.
if (headers.Host.includes(":")) {
headers.Host = `[${headers.Host}]`;
}
}
return {