diff options
author | Chocobozzz <me@florianbigard.com> | 2018-06-22 15:42:55 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-22 15:42:55 +0200 |
commit | 0c237b19fdf9c614293c1442f0ab95a81ce05735 (patch) | |
tree | 81f7ae4262630da5e8041bd70e2cb856e48253a3 /server/helpers/custom-validators/videos.ts | |
parent | c4082b8b4e3684baae0172e97297c936d7419f2c (diff) | |
download | PeerTube-0c237b19fdf9c614293c1442f0ab95a81ce05735.tar.gz PeerTube-0c237b19fdf9c614293c1442f0ab95a81ce05735.tar.zst PeerTube-0c237b19fdf9c614293c1442f0ab95a81ce05735.zip |
Fix images size limit
Diffstat (limited to 'server/helpers/custom-validators/videos.ts')
-rw-r--r-- | server/helpers/custom-validators/videos.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/helpers/custom-validators/videos.ts b/server/helpers/custom-validators/videos.ts index a227136ac..ae392f8c2 100644 --- a/server/helpers/custom-validators/videos.ts +++ b/server/helpers/custom-validators/videos.ts | |||
@@ -86,7 +86,7 @@ const videoFileTypes = Object.keys(VIDEO_MIMETYPE_EXT).map(m => `(${m})`) | |||
86 | const videoFileTypesRegex = videoFileTypes.join('|') | 86 | const videoFileTypesRegex = videoFileTypes.join('|') |
87 | 87 | ||
88 | function isVideoFile (files: { [ fieldname: string ]: Express.Multer.File[] } | Express.Multer.File[]) { | 88 | function isVideoFile (files: { [ fieldname: string ]: Express.Multer.File[] } | Express.Multer.File[]) { |
89 | return isFileValid(files, videoFileTypesRegex, 'videofile') | 89 | return isFileValid(files, videoFileTypesRegex, 'videofile', null) |
90 | } | 90 | } |
91 | 91 | ||
92 | const videoImageTypes = CONSTRAINTS_FIELDS.VIDEOS.IMAGE.EXTNAME | 92 | const videoImageTypes = CONSTRAINTS_FIELDS.VIDEOS.IMAGE.EXTNAME |
@@ -95,7 +95,7 @@ const videoImageTypes = CONSTRAINTS_FIELDS.VIDEOS.IMAGE.EXTNAME | |||
95 | const videoImageTypesRegex = `image/(${videoImageTypes})` | 95 | const videoImageTypesRegex = `image/(${videoImageTypes})` |
96 | 96 | ||
97 | function isVideoImage (files: { [ fieldname: string ]: Express.Multer.File[] } | Express.Multer.File[], field: string) { | 97 | function isVideoImage (files: { [ fieldname: string ]: Express.Multer.File[] } | Express.Multer.File[], field: string) { |
98 | return isFileValid(files, videoImageTypesRegex, field, true) | 98 | return isFileValid(files, videoImageTypesRegex, field, CONSTRAINTS_FIELDS.VIDEOS.IMAGE.FILE_SIZE.max, true) |
99 | } | 99 | } |
100 | 100 | ||
101 | function isVideoPrivacyValid (value: number) { | 101 | function isVideoPrivacyValid (value: number) { |