Build HTTPS URL using Javascript to ensure we use the exact same URL the user used to get there - do not hard-code pi.hole as hostname

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2023-10-08 12:47:44 +02:00
parent 79e66f198f
commit de15123b4e
2 changed files with 7 additions and 10 deletions

View File

@@ -117,4 +117,10 @@ $(function () {
// Clear TOTP field
$("#totp").val("");
// Generate HTTPS redirection link (only used if not already HTTPS)
if (location.protocol !== "https:") {
const url = "https:" + location.href.substring(location.protocol.length);
$("#https-link").attr("href", url);
}
});