mirror of
https://codeberg.org/keyoxide/keyoxide-web.git
synced 2024-12-22 23:09:29 -07:00
Fix CORS related fetch errors
This commit is contained in:
parent
e5e9f70344
commit
20a552cc41
1 changed files with 14 additions and 8 deletions
|
@ -211,19 +211,25 @@ async function displayProfile(opts) {
|
|||
const urlAdvanced = `https://openpgpkey.${domain}/.well-known/openpgpkey/${domain}/hu/${localEncoded}`;
|
||||
const urlDirect = `https://${domain}/.well-known/openpgpkey/hu/${localEncoded}`;
|
||||
|
||||
keyLink = await fetch(urlAdvanced).then(function(response) {
|
||||
if (response.status === 200) {
|
||||
return urlAdvanced;
|
||||
} else {
|
||||
return fetch(urlDirect).then(function(response) {
|
||||
try {
|
||||
keyLink = await fetch(urlAdvanced).then(function(response) {
|
||||
if (response.status === 200) {
|
||||
return urlAdvanced;
|
||||
}
|
||||
});
|
||||
}
|
||||
if (!keyLink) {
|
||||
try {
|
||||
keyLink = await fetch(urlDirect).then(function(response) {
|
||||
if (response.status === 200) {
|
||||
return urlDirect;
|
||||
} else {
|
||||
return "#";
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
if (!keyLink) {
|
||||
keyLink = `https://keys.openpgp.org/pks/lookup?op=get&options=mr&search=0x${keyData.fingerprint}`;
|
||||
}
|
||||
} else {
|
||||
keyLink = `https://keys.openpgp.org/pks/lookup?op=get&options=mr&search=0x${keyData.fingerprint}`;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue