Fix cluster server path being duplicated by proxy (#5550)

This commit is contained in:
Sebastian Malton authored and GitHub committed 2022-06-07 16:13:06 -04:00
1 parent 1b7dd717a5
commit e1152790c3
1 file changed
+2 -5
+2 -5
View File
@@ -152,9 +152,6 @@ export class ContextHandler implements ClusterContextHandler {
protected async newApiTarget(timeout: number): Promise<httpProxy.ServerOptions> {
const kubeAuthProxy = await this.ensureServerHelper();
const ca = this.resolveAuthProxyCa();
const clusterPath = this.clusterUrl.path !== "/" ? this.clusterUrl.path : "";
const apiPrefix = `${kubeAuthProxy.apiPrefix}${clusterPath}`;
const headers: Record<string, string> = {};
if (this.clusterUrl.hostname) {
@@ -166,8 +163,8 @@ export class ContextHandler implements ClusterContextHandler {
protocol: "https:",
host: "127.0.0.1",
port: kubeAuthProxy.port,
path: apiPrefix,
ca,
path: kubeAuthProxy.apiPrefix,
ca: this.resolveAuthProxyCa(),
},
changeOrigin: true,
timeout,