fix bug in context handler

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

No files matched your search

+1 -1
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> {
@@ -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() {