fix(embed): detect uppercase extension in link

This commit is contained in:
plebeius.eth
2024-04-26 16:07:54 +02:00
parent 8e05a6ca52
commit 18a63df59d

View File

@@ -55,7 +55,8 @@ export const getLinkMediaInfo = memoize(
let mime: string | undefined;
try {
mime = extName(url.pathname.slice(url.pathname.lastIndexOf('/') + 1))[0]?.mime;
const fileName = url.pathname.slice(url.pathname.lastIndexOf('/') + 1).toLowerCase();
mime = extName(fileName)[0]?.mime;
if (mime) {
if (mime.startsWith('image')) {
type = mime === 'image/gif' ? 'gif' : 'image';