projects
/
cinny.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bdc10fb
)
Allow mimetypes with suffix in safe check (#808)
author
ginnyTheCat
<ginnythecat@lelux.net>
Sun, 4 Sep 2022 13:45:07 +0000
(15:45 +0200)
committer
GitHub
<noreply@github.com>
Sun, 4 Sep 2022 13:45:07 +0000
(19:15 +0530)
src/util/mimetypes.js
patch
|
blob
|
history
diff --git
a/src/util/mimetypes.js
b/src/util/mimetypes.js
index 121ae0699bb546689692357f418b17437a679f09..7a94e0c8618fc084907a5fff2c648aa1dd55d299 100644
(file)
--- a/
src/util/mimetypes.js
+++ b/
src/util/mimetypes.js
@@
-26,12
+26,13
@@
export const ALLOWED_BLOB_MIMETYPES = [
];
export function getBlobSafeMimeType(mimetype) {
- if (!ALLOWED_BLOB_MIMETYPES.includes(mimetype)) {
+ const [type] = mimetype.split(';');
+ if (!ALLOWED_BLOB_MIMETYPES.includes(type)) {
return 'application/octet-stream';
}
// Required for Chromium browsers
- if (
mime
type === 'video/quicktime') {
+ if (type === 'video/quicktime') {
return 'video/mp4';
}
- return
mime
type;
+ return type;
}