-function signatureValidator (req: express.Request, res: express.Response, next: express.NextFunction) {
- req.checkBody('signature.host', 'Should have a signature host').isURL()
- req.checkBody('signature.signature', 'Should have a signature').notEmpty()
+const signatureValidator = [
+ body('signature.host').custom(isHostValid).withMessage('Should have a signature host'),
+ body('signature.signature').not().isEmpty().withMessage('Should have a signature'),