X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=middlewares%2FreqValidators%2Fremote.js;h=642dad1c777bdee003ea2871493f97f284007495;hb=4d5f813870683c29af6b9959efa9fd4c4ea5e3b7;hp=e851b49a463ccba7680e485057b4b0d17fa2d27a;hpb=34ca3b5225479a5da986c86ee4c42a73ae6df5ad;p=github%2FChocobozzz%2FPeerTube.git diff --git a/middlewares/reqValidators/remote.js b/middlewares/reqValidators/remote.js index e851b49a4..642dad1c7 100644 --- a/middlewares/reqValidators/remote.js +++ b/middlewares/reqValidators/remote.js @@ -18,10 +18,8 @@ } remote.remoteVideosAdd = function (req, res, next) { - req.checkBody('data.name', 'Should have a name').isLength(1, 50) - req.checkBody('data.description', 'Should have a description').isLength(1, 250) - req.checkBody('data.magnetUri', 'Should have a magnetUri').notEmpty() - req.checkBody('data.podUrl', 'Should have a podUrl').isURL() + req.checkBody('data').isArray() + req.checkBody('data').eachIsRemoteVideosAddValid() logger.debug('Checking remoteVideosAdd parameters', { parameters: req.body }) @@ -29,7 +27,8 @@ } remote.remoteVideosRemove = function (req, res, next) { - req.checkBody('data.magnetUri', 'Should have a magnetUri').notEmpty() + req.checkBody('data').isArray() + req.checkBody('data').eachIsRemoteVideosRemoveValid() logger.debug('Checking remoteVideosRemove parameters', { parameters: req.body })