]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/validators/activitypub/signature.ts
feature/ability to disable video history by default (#5728)
[github/Chocobozzz/PeerTube.git] / server / middlewares / validators / activitypub / signature.ts
index f2f7d58487882f84a287581c8ccf39342e1332c7..998d0c0c49fe70955f0e0064cd0e8bf51844145e 100644 (file)
@@ -1,4 +1,4 @@
-import * as express from 'express'
+import express from 'express'
 import { body } from 'express-validator'
 import {
   isSignatureCreatorValid,
@@ -12,21 +12,21 @@ import { areValidationErrors } from '../shared'
 const signatureValidator = [
   body('signature.type')
     .optional()
-    .custom(isSignatureTypeValid).withMessage('Should have a valid signature type'),
+    .custom(isSignatureTypeValid),
   body('signature.created')
     .optional()
     .custom(isDateValid).withMessage('Should have a signature created date that conforms to ISO 8601'),
   body('signature.creator')
     .optional()
-    .custom(isSignatureCreatorValid).withMessage('Should have a valid signature creator'),
+    .custom(isSignatureCreatorValid),
   body('signature.signatureValue')
     .optional()
-    .custom(isSignatureValueValid).withMessage('Should have a valid signature value'),
+    .custom(isSignatureValueValid),
 
   (req: express.Request, res: express.Response, next: express.NextFunction) => {
     logger.debug('Checking Linked Data Signature parameter', { parameters: { signature: req.body.signature } })
 
-    if (areValidationErrors(req, res)) return
+    if (areValidationErrors(req, res, { omitLog: true })) return
 
     return next()
   }