diff options
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 }) |