From afc792b583e394487100caf0195a7eccb8a3bffe Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 8 May 2026 10:24:45 -0400 Subject: [PATCH] fix: honor explicit port argument in urlToApi single-server case The single-server branch added in 0950131b2 ignored the optional port argument and always used location.host. Mirror the multi-server branch by preferring port > location.host. --- web/js/Server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/js/Server.js b/web/js/Server.js index 7d03bd155..61109805d 100644 --- a/web/js/Server.js +++ b/web/js/Server.js @@ -49,7 +49,7 @@ var Server = function() { const path = (this.PathToApi && (this.PathToApi != 'null')) ? this.PathToApi : ''; // Single-server: match browser's host:port (this.Hostname/Port may be wrong behind a proxy). if (!this.Id) { - return protocol + '//' + location.host + path; + return protocol + '//' + (port ? location.hostname + ':' + port : location.host) + path; } return protocol + '//' + this.Hostname + (port ? ':' + port : (this.Port ? ':' + this.Port : (location.port ? ':' + location.port : ''))) + path; }