Browse Source

Merge f2db050877 into 32098ca7d1

pull/7735/merge
7heMech 1 day ago
committed by GitHub
parent
commit
7831293ea0
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 26
      src/static/scripts/admin_diagnostics.js

26
src/static/scripts/admin_diagnostics.js

@ -195,7 +195,14 @@ function checkTimeDrift(utcTimeA, utcTimeB, statusPrefix) {
} }
function checkDomain(browserURL, serverURL) { function checkDomain(browserURL, serverURL) {
if (serverURL == browserURL) { try {
const browser = new URL(browserURL);
const server = new URL(serverURL);
const browserPath = browser.pathname.split("/").filter(Boolean).join("/");
const serverPath = server.pathname.split("/").filter(Boolean).join("/");
if (browser.origin === server.origin && browserPath === serverPath) {
document.getElementById("domain-success").classList.remove("d-none"); document.getElementById("domain-success").classList.remove("d-none");
domainCheck = true; domainCheck = true;
} else { } else {
@ -203,12 +210,27 @@ function checkDomain(browserURL, serverURL) {
} }
// Check for HTTPS at domain-server-string // Check for HTTPS at domain-server-string
if (serverURL.startsWith("https://") ) { if (server.protocol === "https:") {
document.getElementById("https-success").classList.remove("d-none"); document.getElementById("https-success").classList.remove("d-none");
httpsCheck = true; httpsCheck = true;
} else { } else {
document.getElementById("https-warning").classList.remove("d-none"); document.getElementById("https-warning").classList.remove("d-none");
} }
} catch {
if (serverURL == browserURL) {
document.getElementById("domain-success").classList.remove("d-none");
domainCheck = true;
} else {
document.getElementById("domain-warning").classList.remove("d-none");
}
if (serverURL.startsWith("https://")) {
document.getElementById("https-success").classList.remove("d-none");
httpsCheck = true;
} else {
document.getElementById("https-warning").classList.remove("d-none");
}
}
} }
function initVersionCheck(dj) { function initVersionCheck(dj) {

Loading…
Cancel
Save