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