This commit is contained in:
hashbro
2026-08-26 06:45:20 +08:00
parent 533b2bb9e4
commit 3a2be309dc
7 changed files with 50 additions and 9 deletions
+2 -1
View File
@@ -62,6 +62,7 @@
if (ex && ex.host) {
var tls = !!(ex.tls || ex.prefer_https);
var port = Number(tls ? (ex.https_port || 443) : (ex.http_port || 80)) || (tls ? 443 : 80);
if (!tls && port === 443) { tls = true; }
var origin = (tls ? 'https://' : 'http://') + hostOnly(ex.host);
if (!((tls && port === 443) || (!tls && port === 80))) origin += ':' + port;
return origin;
@@ -137,7 +138,7 @@
http_port: (location.port && Number(location.port)) || (location.protocol === 'https:' ? 443 : 80),
https_port: (location.port && Number(location.port)) || (location.protocol === 'https:' ? 443 : 80),
tls: location.protocol === 'https:',
prefer_https: false,
prefer_https: location.protocol === 'https:',
});
api = apiBase();
}