Merge branch 'fix-sub-url-query'

This commit is contained in:
Alexander Zeijlon 2025-03-12 14:54:07 +01:00
commit 59b674d374
1 changed files with 6 additions and 1 deletions

View File

@ -1058,7 +1058,12 @@ const UI = {
if (port) { if (port) {
url.port = port; url.port = port;
} }
url.pathname = '/' + path;
// "./" is needed to force URL() to interpret the path-variable as
// a path and not as an URL. This is relevant if for example path
// starts with more than one "/", in which case it would be
// interpreted as a host name instead.
url = new URL("./" + path, url);
} else { } else {
// Current (May 2024) browsers support relative WebSocket // Current (May 2024) browsers support relative WebSocket
// URLs natively, but we need to support older browsers for // URLs natively, but we need to support older browsers for