diff options
author | Chocobozzz <me@florianbigard.com> | 2018-01-03 11:10:40 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-01-03 11:10:40 +0100 |
commit | 01de67b9a4fcdf01102ccc3cb7dc24beebf6c7ea (patch) | |
tree | 9e01809f09adbcd512a8dedf73093a123f88e02c /server/controllers/api/config.ts | |
parent | 47564bbe2eeb2baae9b7e3f9b2b8d16522bc7e04 (diff) | |
download | PeerTube-01de67b9a4fcdf01102ccc3cb7dc24beebf6c7ea.tar.gz PeerTube-01de67b9a4fcdf01102ccc3cb7dc24beebf6c7ea.tar.zst PeerTube-01de67b9a4fcdf01102ccc3cb7dc24beebf6c7ea.zip |
Add avatar max size limit
Diffstat (limited to 'server/controllers/api/config.ts')
-rw-r--r-- | server/controllers/api/config.ts | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts index 2f1132904..35c89835b 100644 --- a/server/controllers/api/config.ts +++ b/server/controllers/api/config.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { isSignupAllowed } from '../../helpers/utils' | 2 | import { isSignupAllowed } from '../../helpers/utils' |
3 | 3 | ||
4 | import { CONFIG } from '../../initializers' | 4 | import { CONFIG, CONSTRAINTS_FIELDS } from '../../initializers' |
5 | import { asyncMiddleware } from '../../middlewares' | 5 | import { asyncMiddleware } from '../../middlewares' |
6 | import { ServerConfig } from '../../../shared' | 6 | import { ServerConfig } from '../../../shared' |
7 | 7 | ||
@@ -24,6 +24,19 @@ async function getConfig (req: express.Request, res: express.Response, next: exp | |||
24 | }, | 24 | }, |
25 | transcoding: { | 25 | transcoding: { |
26 | enabledResolutions | 26 | enabledResolutions |
27 | }, | ||
28 | avatar: { | ||
29 | file: { | ||
30 | size: { | ||
31 | max: CONSTRAINTS_FIELDS.ACTORS.AVATAR.FILE_SIZE.max | ||
32 | }, | ||
33 | extensions: CONSTRAINTS_FIELDS.ACTORS.AVATAR.EXTNAME | ||
34 | } | ||
35 | }, | ||
36 | video: { | ||
37 | file: { | ||
38 | extensions: CONSTRAINTS_FIELDS.VIDEOS.EXTNAME | ||
39 | } | ||
27 | } | 40 | } |
28 | } | 41 | } |
29 | 42 | ||