blob: e0225f30cea88a90a5bf9eb804af0b80cc684d87 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
import * as express from 'express'
import { body } from 'express-validator/check'
import { logger } from '../../../helpers'
import { isRootActivityValid } from '../../../helpers/custom-validators/activitypub'
import { areValidationErrors } from '../utils'
const activityPubValidator = [
body('').custom((value, { req }) => isRootActivityValid(req.body)),
(req: express.Request, res: express.Response, next: express.NextFunction) => {
logger.debug('Checking activity pub parameters')
if (areValidationErrors(req, res)) return
return next()
}
]
// ---------------------------------------------------------------------------
export {
activityPubValidator
}
|