diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2015-11-07 14:16:26 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2015-11-07 14:16:26 +0100 |
commit | 34ca3b5225479a5da986c86ee4c42a73ae6df5ad (patch) | |
tree | 561ba5ae1adccd5729305a8cc17d13d24a0c2ddb /routes/api/v1/remoteVideos.js | |
parent | f5a60a5138135a3412dfbcfd6e564f7aa47a55c2 (diff) | |
download | PeerTube-34ca3b5225479a5da986c86ee4c42a73ae6df5ad.tar.gz PeerTube-34ca3b5225479a5da986c86ee4c42a73ae6df5ad.tar.zst PeerTube-34ca3b5225479a5da986c86ee4c42a73ae6df5ad.zip |
Add requests parameters validations
Diffstat (limited to 'routes/api/v1/remoteVideos.js')
-rw-r--r-- | routes/api/v1/remoteVideos.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/routes/api/v1/remoteVideos.js b/routes/api/v1/remoteVideos.js index 88b8e879b..23bdcbe24 100644 --- a/routes/api/v1/remoteVideos.js +++ b/routes/api/v1/remoteVideos.js | |||
@@ -4,6 +4,7 @@ | |||
4 | var express = require('express') | 4 | var express = require('express') |
5 | var router = express.Router() | 5 | var router = express.Router() |
6 | var middleware = require('../../../middlewares') | 6 | var middleware = require('../../../middlewares') |
7 | var requestValidator = require('../../../middlewares/reqValidators').remote | ||
7 | var videos = require('../../../src/videos') | 8 | var videos = require('../../../src/videos') |
8 | 9 | ||
9 | function addRemoteVideos (req, res, next) { | 10 | function addRemoteVideos (req, res, next) { |
@@ -22,8 +23,8 @@ | |||
22 | }) | 23 | }) |
23 | } | 24 | } |
24 | 25 | ||
25 | router.post('/add', middleware.cache(false), middleware.decryptBody, addRemoteVideos) | 26 | router.post('/add', requestValidator.secureRequest, middleware.decryptBody, requestValidator.remoteVideosAdd, middleware.cache(false), addRemoteVideos) |
26 | router.post('/remove', middleware.cache(false), middleware.decryptBody, removeRemoteVideo) | 27 | router.post('/remove', requestValidator.secureRequest, middleware.decryptBody, requestValidator.remoteVideosRemove, middleware.cache(false), removeRemoteVideo) |
27 | 28 | ||
28 | module.exports = router | 29 | module.exports = router |
29 | })() | 30 | })() |