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/users.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/users.ts')
-rw-r--r-- | server/helpers/custom-validators/users.ts | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/server/helpers/custom-validators/users.ts b/server/helpers/custom-validators/users.ts index b59b766de..ce1323e94 100644 --- a/server/helpers/custom-validators/users.ts +++ b/server/helpers/custom-validators/users.ts | |||
@@ -2,7 +2,6 @@ import 'express-validator' | |||
2 | import * as validator from 'validator' | 2 | import * as validator from 'validator' |
3 | import { UserRole } from '../../../shared' | 3 | import { UserRole } from '../../../shared' |
4 | import { CONSTRAINTS_FIELDS, NSFW_POLICY_TYPES } from '../../initializers' | 4 | import { CONSTRAINTS_FIELDS, NSFW_POLICY_TYPES } from '../../initializers' |
5 | |||
6 | import { exists, isFileValid } from './misc' | 5 | import { exists, isFileValid } from './misc' |
7 | import { values } from 'lodash' | 6 | import { values } from 'lodash' |
8 | 7 | ||
@@ -52,7 +51,7 @@ const avatarMimeTypes = CONSTRAINTS_FIELDS.ACTORS.AVATAR.EXTNAME | |||
52 | .join('|') | 51 | .join('|') |
53 | const avatarMimeTypesRegex = `image/(${avatarMimeTypes})` | 52 | const avatarMimeTypesRegex = `image/(${avatarMimeTypes})` |
54 | function isAvatarFile (files: { [ fieldname: string ]: Express.Multer.File[] } | Express.Multer.File[]) { | 53 | function isAvatarFile (files: { [ fieldname: string ]: Express.Multer.File[] } | Express.Multer.File[]) { |
55 | return isFileValid(files, avatarMimeTypesRegex, 'avatarfile') | 54 | return isFileValid(files, avatarMimeTypesRegex, 'avatarfile', CONSTRAINTS_FIELDS.ACTORS.AVATAR.FILE_SIZE.max) |
56 | } | 55 | } |
57 | 56 | ||
58 | // --------------------------------------------------------------------------- | 57 | // --------------------------------------------------------------------------- |