feat(api): Add new admin emoji API

This commit is contained in:
Jesse Wierzbinski 2024-05-11 15:27:28 -10:00
parent b979daa39a
commit 8fedd1a07d
No known key found for this signature in database
20 changed files with 954 additions and 167 deletions

View file

@ -40,3 +40,15 @@ export const urlToContentFormat = (
},
};
};
export const mimeLookup = async (url: string) => {
const naiveLookup = lookup(url.replace(new URL(url).search, ""));
if (naiveLookup) return naiveLookup;
const fetchLookup = fetch(url, { method: "HEAD" }).then(
(response) => response.headers.get("content-type") || "",
);
return fetchLookup;
};