Skip to content

Commit

Permalink
fix(embed): detect uppercase extension in link
Browse files Browse the repository at this point in the history
  • Loading branch information
plebeius-eth committed Apr 26, 2024
1 parent 8e05a6c commit 18a63df
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/utils/media-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 18a63df

Please sign in to comment.