mirror of
https://github.com/versia-pub/server.git
synced 2026-04-27 20:59:15 +02:00
feat(api): ✨ Add new admin emoji API
This commit is contained in:
parent
b979daa39a
commit
8fedd1a07d
20 changed files with 954 additions and 167 deletions
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue