From 380ad888cf8a1551e43e3e898f2ced8614ad12ab Mon Sep 17 00:00:00 2001 From: Tom Hellier Date: Mon, 27 Jun 2022 14:59:44 +0100 Subject: [PATCH] fix: websockets for terminal not working on subPath 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}`