From 549ee0a94580f16494ffa14138d8e4f6567c2853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EC=A7=80=EC=9B=90?= Date: Thu, 5 Sep 2024 14:56:34 +0900 Subject: [PATCH] fix(containers): correct base URL construction for console access Fixed an issue where the base URL for WebSocket connection in the console was being duplicated. The base href and window.location.origin were both set to "http://localhost:49000", resulting in a duplicated URL like "http://localhost:49000http://localhost:49000". This fix ensures that the base URL is properly constructed without duplication. --- .../views/containers/console/containerConsoleController.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/docker/views/containers/console/containerConsoleController.js b/app/docker/views/containers/console/containerConsoleController.js index 5cc792b08..d0e95afb9 100644 --- a/app/docker/views/containers/console/containerConsoleController.js +++ b/app/docker/views/containers/console/containerConsoleController.js @@ -57,7 +57,7 @@ angular.module('portainer.docker').controller('ContainerConsoleController', [ id: attachId, }; - const base = window.location.origin.startsWith('http') ? `${window.location.origin}${baseHref()}` : baseHref(); + const base = window.location.origin.startsWith('http') && !window.ddExtension ? `${window.location.origin}${baseHref()}` : baseHref(); var url = base + 'api/websocket/attach?' + @@ -96,7 +96,7 @@ angular.module('portainer.docker').controller('ContainerConsoleController', [ id: data.Id, }; - const base = window.location.origin.startsWith('http') ? `${window.location.origin}${baseHref()}` : baseHref(); + const base = window.location.origin.startsWith('http') && !window.ddExtension ? `${window.location.origin}${baseHref()}` : baseHref(); var url = base + 'api/websocket/exec?' +