fix(embed): detect uppercase extension in link

This commit is contained in:
plebeius.eth
2024-04-26 16:07:35 +02:00
parent 394c7d8a81
commit 86738de226
+2 -1
View File
@@ -56,7 +56,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';