From 0d0d5fc8e57143311fa35e22068a8f384d29f184 Mon Sep 17 00:00:00 2001 From: TomHellier Date: Mon, 27 Jun 2022 18:25:52 +0100 Subject: [PATCH] fix: websockets for terminal not working on subPath (#9795) Signed-off-by: Tom Hellier --- .../components/pod-terminal-viewer/pod-terminal-viewer.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/src/app/applications/components/pod-terminal-viewer/pod-terminal-viewer.tsx b/ui/src/app/applications/components/pod-terminal-viewer/pod-terminal-viewer.tsx index 5d29777b563b..b4d4b423da99 100644 --- a/ui/src/app/applications/components/pod-terminal-viewer/pod-terminal-viewer.tsx +++ b/ui/src/app/applications/components/pod-terminal-viewer/pod-terminal-viewer.tsx @@ -141,8 +141,9 @@ export const PodTerminalViewer: React.FC = ({selectedNod function setupConnection() { const {name = '', namespace = ''} = selectedNode || {}; + const url = `${location.host}${appContext.baseHref}`.replace(/\/$/, ''); webSocket = new WebSocket( - `${location.protocol === 'https:' ? 'wss' : 'ws'}://${location.host}/terminal?pod=${name}&container=${AppUtils.getContainerName( + `${location.protocol === 'https:' ? 'wss' : 'ws'}://${url}/terminal?pod=${name}&container=${AppUtils.getContainerName( podState, activeContainer )}&appName=${applicationName}&projectName=${projectName}&namespace=${namespace}`