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

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

This commit is contained in:
Sebastian Malton 2022-06-07 16:13:06 -04:00
parent 1260fac281
commit 6a218c37d2

View File

@ -141,17 +141,13 @@ export class ContextHandler {
protected async newApiTarget(timeout: number): Promise<httpProxy.ServerOptions> { protected async newApiTarget(timeout: number): Promise<httpProxy.ServerOptions> {
await this.ensureServer(); await this.ensureServer();
const ca = this.dependencies.authProxyCa;
const clusterPath = this.clusterUrl.path !== "/" ? this.clusterUrl.path : "";
const apiPrefix = `${this.kubeAuthProxy.apiPrefix}${clusterPath}`;
return { return {
target: { target: {
protocol: "https:", protocol: "https:",
host: "127.0.0.1", host: "127.0.0.1",
port: this.kubeAuthProxy.port, port: this.kubeAuthProxy.port,
path: apiPrefix, path: this.kubeAuthProxy.apiPrefix,
ca, ca: this.dependencies.authProxyCa,
}, },
changeOrigin: true, changeOrigin: true,
timeout, timeout,