1
0
Fork 0
peertube/server/middlewares/validators/activitypub/activity.ts
2017-11-27 19:40:51 +01:00

21 lines
576 B
TypeScript

import { body } from 'express-validator/check'
import * as express from 'express'
import { logger, isRootActivityValid } from '../../../helpers'
import { checkErrors } from '../utils'
const activityPubValidator = [
body('data').custom(isRootActivityValid),
(req: express.Request, res: express.Response, next: express.NextFunction) => {
logger.debug('Checking activity pub parameters', { parameters: req.body })
checkErrors(req, res, next)
}
]
// ---------------------------------------------------------------------------
export {
activityPubValidator
}