diff options
Diffstat (limited to 'server/middlewares/validators/pods.ts')
-rw-r--r-- | server/middlewares/validators/pods.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/server/middlewares/validators/pods.ts b/server/middlewares/validators/pods.ts index c55a88b85..d8eb90168 100644 --- a/server/middlewares/validators/pods.ts +++ b/server/middlewares/validators/pods.ts | |||
@@ -1,3 +1,6 @@ | |||
1 | import 'express-validator' | ||
2 | import * as express from 'express' | ||
3 | |||
1 | import { database as db } from '../../initializers/database' | 4 | import { database as db } from '../../initializers/database' |
2 | import { checkErrors } from './utils' | 5 | import { checkErrors } from './utils' |
3 | import { logger } from '../../helpers' | 6 | import { logger } from '../../helpers' |
@@ -5,7 +8,7 @@ import { CONFIG } from '../../initializers' | |||
5 | import { hasFriends } from '../../lib' | 8 | import { hasFriends } from '../../lib' |
6 | import { isTestInstance } from '../../helpers' | 9 | import { isTestInstance } from '../../helpers' |
7 | 10 | ||
8 | function makeFriendsValidator (req, res, next) { | 11 | function makeFriendsValidator (req: express.Request, res: express.Response, next: express.NextFunction) { |
9 | // Force https if the administrator wants to make friends | 12 | // Force https if the administrator wants to make friends |
10 | if (isTestInstance() === false && CONFIG.WEBSERVER.SCHEME === 'http') { | 13 | if (isTestInstance() === false && CONFIG.WEBSERVER.SCHEME === 'http') { |
11 | return res.status(400).send('Cannot make friends with a non HTTPS webserver.') | 14 | return res.status(400).send('Cannot make friends with a non HTTPS webserver.') |
@@ -32,7 +35,7 @@ function makeFriendsValidator (req, res, next) { | |||
32 | }) | 35 | }) |
33 | } | 36 | } |
34 | 37 | ||
35 | function podsAddValidator (req, res, next) { | 38 | function podsAddValidator (req: express.Request, res: express.Response, next: express.NextFunction) { |
36 | req.checkBody('host', 'Should have a host').isHostValid() | 39 | req.checkBody('host', 'Should have a host').isHostValid() |
37 | req.checkBody('email', 'Should have an email').isEmail() | 40 | req.checkBody('email', 'Should have an email').isEmail() |
38 | req.checkBody('publicKey', 'Should have a public key').notEmpty() | 41 | req.checkBody('publicKey', 'Should have a public key').notEmpty() |