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.
pull/12191/head
강지원 3 months ago
parent 4bb5a7f480
commit 549ee0a945

@ -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?' +

Loading…
Cancel
Save