diff options
author | Chocobozzz <me@florianbigard.com> | 2022-08-17 14:27:04 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-08-17 14:27:04 +0200 |
commit | 396f6f0140b0f76162e2378fd5a61e2f888673ed (patch) | |
tree | a5bd668bfc7dca7f311b9fc42ebb8bd01f462648 /server/middlewares/validators/oembed.ts | |
parent | 97eba003a9d0adcb0cab9190f566327b1417c7d3 (diff) | |
download | PeerTube-396f6f0140b0f76162e2378fd5a61e2f888673ed.tar.gz PeerTube-396f6f0140b0f76162e2378fd5a61e2f888673ed.tar.zst PeerTube-396f6f0140b0f76162e2378fd5a61e2f888673ed.zip |
Cleanup useless express validator messages
Diffstat (limited to 'server/middlewares/validators/oembed.ts')
-rw-r--r-- | server/middlewares/validators/oembed.ts | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/server/middlewares/validators/oembed.ts b/server/middlewares/validators/oembed.ts index 8e7b44a86..fa90dd05c 100644 --- a/server/middlewares/validators/oembed.ts +++ b/server/middlewares/validators/oembed.ts | |||
@@ -39,10 +39,17 @@ if (isTestOrDevInstance()) { | |||
39 | } | 39 | } |
40 | 40 | ||
41 | const oembedValidator = [ | 41 | const oembedValidator = [ |
42 | query('url').isURL(isURLOptions).withMessage('Should have a valid url'), | 42 | query('url') |
43 | query('maxwidth').optional().isInt().withMessage('Should have a valid max width'), | 43 | .isURL(isURLOptions), |
44 | query('maxheight').optional().isInt().withMessage('Should have a valid max height'), | 44 | query('maxwidth') |
45 | query('format').optional().isIn([ 'xml', 'json' ]).withMessage('Should have a valid format'), | 45 | .optional() |
46 | .isInt(), | ||
47 | query('maxheight') | ||
48 | .optional() | ||
49 | .isInt(), | ||
50 | query('format') | ||
51 | .optional() | ||
52 | .isIn([ 'xml', 'json' ]), | ||
46 | 53 | ||
47 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 54 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
48 | logger.debug('Checking oembed parameters', { parameters: req.query }) | 55 | logger.debug('Checking oembed parameters', { parameters: req.query }) |