]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/middlewares/validators/activitypub/activity.ts
0de8b2d85bb03a7278da550864766d1a27c62a88
[github/Chocobozzz/PeerTube.git] / server / middlewares / validators / activitypub / activity.ts
1 import * as express from 'express'
2 import { body } from 'express-validator/check'
3 import { isRootActivityValid, logger } from '../../../helpers'
4 import { checkErrors } from '../utils'
5
6 const activityPubValidator = [
7 body('').custom((value, { req }) => isRootActivityValid(req.body)),
8
9 (req: express.Request, res: express.Response, next: express.NextFunction) => {
10 logger.debug('Checking activity pub parameters', { parameters: req.body })
11
12 checkErrors(req, res, next)
13 }
14 ]
15
16 // ---------------------------------------------------------------------------
17
18 export {
19 activityPubValidator
20 }