X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmiddlewares%2FreqValidators%2Fvideos.js;h=d444c9f0abd8b11dba3f308d2727dfc953595ead;hb=46246b5f194caafba4e3a72e9365acd8b35785de;hp=6e6e75fb319ae42ade94f9e858df5d671cc9f850;hpb=67100f1f971dd10a466a321899b56c0813e08d31;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/middlewares/reqValidators/videos.js b/server/middlewares/reqValidators/videos.js index 6e6e75fb3..d444c9f0a 100644 --- a/server/middlewares/reqValidators/videos.js +++ b/server/middlewares/reqValidators/videos.js @@ -30,7 +30,7 @@ function videosAdd (req, res, next) { } if (duration > constants.MAXIMUM_VIDEO_DURATION) { - return res.status(400).send('Duration of the video file is too big.') + return res.status(400).send('Duration of the video file is too big (' + constants.MAXIMUM_VIDEO_DURATION + ').') } videoFile.duration = duration @@ -81,7 +81,9 @@ function videosRemove (req, res, next) { } function videosSearch (req, res, next) { - req.checkParams('name', 'Should have a name').notEmpty() + const searchableColumns = constants.SEARCHABLE_COLUMNS.VIDEOS + req.checkParams('value', 'Should have a name').notEmpty() + req.checkQuery('field', 'Should have correct searchable column').optional().isIn(searchableColumns) logger.debug('Checking videosSearch parameters', { parameters: req.params })