Fix crash with unknown mime type
This commit is contained in:
@@ -26,6 +26,7 @@ export const ALLOWED_BLOB_MIMETYPES = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
export function getBlobSafeMimeType(mimetype) {
|
export function getBlobSafeMimeType(mimetype) {
|
||||||
|
if (typeof mimetype !== 'string') return 'application/octet-stream';
|
||||||
const [type] = mimetype.split(';');
|
const [type] = mimetype.split(';');
|
||||||
if (!ALLOWED_BLOB_MIMETYPES.includes(type)) {
|
if (!ALLOWED_BLOB_MIMETYPES.includes(type)) {
|
||||||
return 'application/octet-stream';
|
return 'application/octet-stream';
|
||||||
|
|||||||
Reference in New Issue
Block a user