]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/middlewares/validators/activitypub/activity.ts
Propagate old comment on new follow
[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 } from '../../../helpers/custom-validators/activitypub/activity'
4 import { logger } from '../../../helpers/logger'
5 import { areValidationErrors } from '../utils'
6
7 const activityPubValidator = [
8 body('').custom((value, { req }) => isRootActivityValid(req.body)),
9
10 (req: express.Request, res: express.Response, next: express.NextFunction) => {
11 logger.debug('Checking activity pub parameters')
12
13 if (areValidationErrors(req, res)) return
14
15 return next()
16 }
17 ]
18
19 // ---------------------------------------------------------------------------
20
21 export {
22 activityPubValidator
23 }