X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Fcustom-validators%2Fvideo-captions.ts;h=177e9e86ed45b475e1e9f007bb3ad2c091a00023;hb=5cf84858d49f4231cc4efec5e3132f17f65f6cf6;hp=6b1729f36935c4afb845d415ef7607d8b6d66af0;hpb=cf7a61b5a2b68fd966c4a355e37e84b048ed296b;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/helpers/custom-validators/video-captions.ts b/server/helpers/custom-validators/video-captions.ts index 6b1729f36..177e9e86e 100644 --- a/server/helpers/custom-validators/video-captions.ts +++ b/server/helpers/custom-validators/video-captions.ts @@ -8,7 +8,9 @@ function isVideoCaptionLanguageValid (value: any) { return exists(value) && VIDEO_LANGUAGES[ value ] !== undefined } -const videoCaptionTypes = Object.keys(VIDEO_CAPTIONS_MIMETYPE_EXT).map(m => `(${m})`) +const videoCaptionTypes = Object.keys(VIDEO_CAPTIONS_MIMETYPE_EXT) + .concat([ 'application/octet-stream' ]) // MacOS sends application/octet-stream >< + .map(m => `(${m})`) const videoCaptionTypesRegex = videoCaptionTypes.join('|') function isVideoCaptionFile (files: { [ fieldname: string ]: Express.Multer.File[] } | Express.Multer.File[], field: string) { return isFileValid(files, videoCaptionTypesRegex, field, CONSTRAINTS_FIELDS.VIDEO_CAPTIONS.CAPTION_FILE.FILE_SIZE.max)