From 9d9867f67404c093619925cf6c65d9ed7051f658 Mon Sep 17 00:00:00 2001 From: Lauri Nevala Date: Fri, 11 Sep 2020 14:24:24 +0300 Subject: [PATCH] Add path to auth proxy url if present in cluster url (#856) Signed-off-by: Lauri Nevala --- src/main/context-handler.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/context-handler.ts b/src/main/context-handler.ts index 32e933d8d4..a3cf6185dd 100644 --- a/src/main/context-handler.ts +++ b/src/main/context-handler.ts @@ -70,7 +70,8 @@ export class ContextHandler { async resolveAuthProxyUrl() { const proxyPort = await this.ensurePort(); - return `http://127.0.0.1:${proxyPort}`; + const path = this.clusterUrl.path !== "/" ? this.clusterUrl.path : "" + return `http://127.0.0.1:${proxyPort}${path}`; } async getApiTarget(isWatchRequest = false): Promise { @@ -88,7 +89,7 @@ export class ContextHandler { protected async newApiTarget(timeout: number): Promise { const proxyUrl = await this.resolveAuthProxyUrl(); return { - target: proxyUrl + this.clusterUrl.path, + target: proxyUrl, changeOrigin: true, timeout: timeout, headers: {