From dad9157d840395fff96c8bd92d4e678a475fe52c Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Fri, 2 Jun 2023 18:12:01 +0800 Subject: [PATCH] Don't overwrite original variable --- src/webui/www/private/scripts/client.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/webui/www/private/scripts/client.js b/src/webui/www/private/scripts/client.js index d667b6329..70399095a 100644 --- a/src/webui/www/private/scripts/client.js +++ b/src/webui/www/private/scripts/client.js @@ -116,8 +116,7 @@ function getHost(url) { try { // hack: URL can not get hostname from udp protocol - url = url.replace(/^udp:/, 'https:'); - const parsedUrl = new URL(url); + const parsedUrl = new URL(url.replace(/^udp:/, 'https:')); // host: "example.com:8443" // hostname: "example.com" const host = parsedUrl.hostname;