forked from OpenNeo/impress
use head request for loading image hash
This commit is contained in:
parent
1cef0bea20
commit
91b9c91520
1 changed files with 1 additions and 0 deletions
|
|
@ -60,6 +60,7 @@ const PETS_CP_URL_PATTERN =
|
||||||
/https?:\/\/pets\.neopets\.com\/cp\/([a-z0-9]+)\/[0-9]+\/[0-9]+\.png/;
|
/https?:\/\/pets\.neopets\.com\/cp\/([a-z0-9]+)\/[0-9]+\/[0-9]+\.png/;
|
||||||
async function loadImageHashFromPetName(petName) {
|
async function loadImageHashFromPetName(petName) {
|
||||||
const res = await fetch(`https://pets.neopets.com/cpn/${petName}/1/1.png`, {
|
const res = await fetch(`https://pets.neopets.com/cpn/${petName}/1/1.png`, {
|
||||||
|
method: "HEAD",
|
||||||
redirect: "manual",
|
redirect: "manual",
|
||||||
});
|
});
|
||||||
if (res.status !== 302) {
|
if (res.status !== 302) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue