mirror of
https://codeberg.org/keyoxide/keyoxide-web.git
synced 2024-12-22 23:09:29 -07:00
Fix hardcoded hostname
This commit is contained in:
parent
dc0f16bced
commit
12d62cc3c8
1 changed files with 6 additions and 4 deletions
|
@ -837,18 +837,20 @@ async function computeWKDLocalPart(message) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function generateProfileURL(data) {
|
async function generateProfileURL(data) {
|
||||||
|
let hostname = window.location.hostname;
|
||||||
|
|
||||||
if (data.input == "") {
|
if (data.input == "") {
|
||||||
return "Waiting for input...";
|
return "Waiting for input...";
|
||||||
}
|
}
|
||||||
switch (data.source) {
|
switch (data.source) {
|
||||||
case "wkd":
|
case "wkd":
|
||||||
return `https://keyoxide.org/${data.input}`;
|
return `https://${hostname}/${data.input}`;
|
||||||
break;
|
break;
|
||||||
case "hkp":
|
case "hkp":
|
||||||
if (/.*@.*\..*/.test(data.input)) {
|
if (/.*@.*\..*/.test(data.input)) {
|
||||||
return `https://keyoxide.org/hkp/${data.input}`;
|
return `https://${hostname}/hkp/${data.input}`;
|
||||||
} else {
|
} else {
|
||||||
return `https://keyoxide.org/${data.input}`;
|
return `https://${hostname}/${data.input}`;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "keybase":
|
case "keybase":
|
||||||
|
@ -857,7 +859,7 @@ async function generateProfileURL(data) {
|
||||||
return "Incorrect Keybase public key URL.";
|
return "Incorrect Keybase public key URL.";
|
||||||
}
|
}
|
||||||
const match = data.input.match(re);
|
const match = data.input.match(re);
|
||||||
return `https://keyoxide.org/keybase/${match[1]}/${match[2]}`;
|
return `https://${hostname}/keybase/${match[1]}/${match[2]}`;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue