]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/validators/oembed.ts
Cleanup useless express validator messages
[github/Chocobozzz/PeerTube.git] / server / middlewares / validators / oembed.ts
index 8e7b44a86adeded2286efa6e51cc14582271a23a..fa90dd05c91d1b294c3c6a51cf2a2c4fdaf531d6 100644 (file)
@@ -39,10 +39,17 @@ if (isTestOrDevInstance()) {
 }
 
 const oembedValidator = [
-  query('url').isURL(isURLOptions).withMessage('Should have a valid url'),
-  query('maxwidth').optional().isInt().withMessage('Should have a valid max width'),
-  query('maxheight').optional().isInt().withMessage('Should have a valid max height'),
-  query('format').optional().isIn([ 'xml', 'json' ]).withMessage('Should have a valid format'),
+  query('url')
+    .isURL(isURLOptions),
+  query('maxwidth')
+    .optional()
+    .isInt(),
+  query('maxheight')
+    .optional()
+    .isInt(),
+  query('format')
+    .optional()
+    .isIn([ 'xml', 'json' ]),
 
   async (req: express.Request, res: express.Response, next: express.NextFunction) => {
     logger.debug('Checking oembed parameters', { parameters: req.query })