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:
parent
a3455278b5
commit
61cd3e4b5b
@ -118,7 +118,7 @@ export class ContextHandler {
|
|||||||
await this.ensureServer();
|
await this.ensureServer();
|
||||||
const path = this.clusterUrl.path !== "/" ? this.clusterUrl.path : "";
|
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> {
|
async getApiTarget(isLongRunningRequest = false): Promise<httpProxy.ServerOptions> {
|
||||||
|
|||||||
@ -8,7 +8,6 @@ import { waitUntilUsed } from "tcp-port-used";
|
|||||||
import { randomBytes } from "crypto";
|
import { randomBytes } from "crypto";
|
||||||
import type { Cluster } from "../../common/cluster/cluster";
|
import type { Cluster } from "../../common/cluster/cluster";
|
||||||
import logger from "../logger";
|
import logger from "../logger";
|
||||||
import * as url from "url";
|
|
||||||
import { getPortFrom } from "../utils/get-port";
|
import { getPortFrom } from "../utils/get-port";
|
||||||
import { makeObservable, observable, when } from "mobx";
|
import { makeObservable, observable, when } from "mobx";
|
||||||
|
|
||||||
@ -27,13 +26,10 @@ export class KubeAuthProxy {
|
|||||||
|
|
||||||
protected _port: number;
|
protected _port: number;
|
||||||
protected proxyProcess?: ChildProcess;
|
protected proxyProcess?: ChildProcess;
|
||||||
protected readonly acceptHosts: string;
|
|
||||||
@observable protected ready = false;
|
@observable protected ready = false;
|
||||||
|
|
||||||
constructor(private dependencies: Dependencies, protected readonly cluster: Cluster, protected readonly env: NodeJS.ProcessEnv) {
|
constructor(private dependencies: Dependencies, protected readonly cluster: Cluster, protected readonly env: NodeJS.ProcessEnv) {
|
||||||
makeObservable(this);
|
makeObservable(this);
|
||||||
|
|
||||||
this.acceptHosts = url.parse(this.cluster.apiUrl).hostname;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get whenReady() {
|
get whenReady() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user