]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/middlewares/validators/remote/signature.ts
Remove ng2-completer
[github/Chocobozzz/PeerTube.git] / server / middlewares / validators / remote / signature.ts
CommitLineData
69818c93
C
1import 'express-validator'
2import * as express from 'express'
3
65fcc311
C
4import { logger } from '../../../helpers'
5import { checkErrors } from '../utils'
34ca3b52 6
69818c93 7function signatureValidator (req: express.Request, res: express.Response, next: express.NextFunction) {
49abbbbe 8 req.checkBody('signature.host', 'Should have a signature host').isURL()
9f10b292 9 req.checkBody('signature.signature', 'Should have a signature').notEmpty()
c45f7f84 10
bdfbd4f1 11 logger.debug('Checking signature parameters', { parameters: { signature: req.body.signature } })
c45f7f84 12
9f10b292
C
13 checkErrors(req, res, next)
14}
c45f7f84 15
9f10b292 16// ---------------------------------------------------------------------------
c45f7f84 17
65fcc311
C
18export {
19 signatureValidator
20}