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

fix bug in context handler

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen 2022-02-28 09:58:55 +02:00
parent a3455278b5
commit 61cd3e4b5b
2 changed files with 1 additions and 5 deletions

View File

@ -118,7 +118,7 @@ export class ContextHandler {
await this.ensureServer();
const path = this.clusterUrl.path !== "/" ? this.clusterUrl.path : "";
return `http://127.0.0.1:${this.kubeAuthProxy.port}${this.kubeAuthProxy.apiPrefix}${path}`;
return `http://127.0.0.1:${this.kubeAuthProxy.port}${this.kubeAuthProxy.apiPrefix.slice(0, -1)}${path}`;
}
async getApiTarget(isLongRunningRequest = false): Promise<httpProxy.ServerOptions> {

View File

@ -8,7 +8,6 @@ import { waitUntilUsed } from "tcp-port-used";
import { randomBytes } from "crypto";
import type { Cluster } from "../../common/cluster/cluster";
import logger from "../logger";
import * as url from "url";
import { getPortFrom } from "../utils/get-port";
import { makeObservable, observable, when } from "mobx";
@ -27,13 +26,10 @@ export class KubeAuthProxy {
protected _port: number;
protected proxyProcess?: ChildProcess;
protected readonly acceptHosts: string;
@observable protected ready = false;
constructor(private dependencies: Dependencies, protected readonly cluster: Cluster, protected readonly env: NodeJS.ProcessEnv) {
makeObservable(this);
this.acceptHosts = url.parse(this.cluster.apiUrl).hostname;
}
get whenReady() {