From 12d62cc3c838bdc76c448fa8ec2985c5d12f52bc Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Fri, 14 Aug 2020 15:16:41 +0200 Subject: [PATCH] Fix hardcoded hostname --- static/scripts.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/static/scripts.js b/static/scripts.js index 7296b0c..1f8ca7b 100644 --- a/static/scripts.js +++ b/static/scripts.js @@ -837,18 +837,20 @@ async function computeWKDLocalPart(message) { } async function generateProfileURL(data) { + let hostname = window.location.hostname; + if (data.input == "") { return "Waiting for input..."; } switch (data.source) { case "wkd": - return `https://keyoxide.org/${data.input}`; + return `https://${hostname}/${data.input}`; break; case "hkp": if (/.*@.*\..*/.test(data.input)) { - return `https://keyoxide.org/hkp/${data.input}`; + return `https://${hostname}/hkp/${data.input}`; } else { - return `https://keyoxide.org/${data.input}`; + return `https://${hostname}/${data.input}`; } break; case "keybase": @@ -857,7 +859,7 @@ async function generateProfileURL(data) { return "Incorrect Keybase public key URL."; } const match = data.input.match(re); - return `https://keyoxide.org/keybase/${match[1]}/${match[2]}`; + return `https://${hostname}/keybase/${match[1]}/${match[2]}`; break; } }