Skip to content

Commit 078ee5e

Browse files
committed
improve content type to extension logic
1 parent 3af0bde commit 078ee5e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ts/util/Attachment.std.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ export const getFileExtension = (
772772
case 'audio/mpeg':
773773
return 'mp3';
774774
default:
775-
return attachment.contentType.split('/')[1];
775+
return attachment.contentType.split('/')[1].split(/[+;\s]/)[0];
776776
}
777777
};
778778

0 commit comments

Comments
 (0)