mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-01-04 05:46:15 +00:00
Fix crash with unknown mime type
This commit is contained in:
parent
19f674cf5f
commit
2ded7d9b1f
|
@ -26,6 +26,7 @@ export const ALLOWED_BLOB_MIMETYPES = [
|
|||
];
|
||||
|
||||
export function getBlobSafeMimeType(mimetype) {
|
||||
if (typeof mimetype !== 'string') return 'application/octet-stream';
|
||||
const [type] = mimetype.split(';');
|
||||
if (!ALLOWED_BLOB_MIMETYPES.includes(type)) {
|
||||
return 'application/octet-stream';
|
||||
|
|
Loading…
Reference in a new issue