]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/custom-validators/video-captions.ts
Add federation to ownership change
[github/Chocobozzz/PeerTube.git] / server / helpers / custom-validators / video-captions.ts
index 6b1729f36935c4afb845d415ef7607d8b6d66af0..177e9e86ed45b475e1e9f007bb3ad2c091a00023 100644 (file)
@@ -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)