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

Minor changes

- fix lint error
- move the code inside the clusterUrl.hostname check
- add small Comment to explane the code

Signed-off-by: dominic_dl <me@dominic.link>
This commit is contained in:
dominic_dl 2022-08-20 12:14:29 +02:00
parent 2a520c0997
commit 18ab16c58b

View File

@ -155,10 +155,12 @@ export class ContextHandler implements ClusterContextHandler {
if (this.clusterUrl.hostname) { if (this.clusterUrl.hostname) {
headers.Host = this.clusterUrl.hostname; headers.Host = this.clusterUrl.hostname;
}
if (headers.Host.includes(":")) { // fix current IPv6 inconsistency in url.Parse() and httpProxy.
headers.Host = "[" + headers.Host + "]"; // 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 { return {