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 GitHub
parent 4b1c9fb5fd
commit ac6a5f9b83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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 {