diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-11-14 20:03:04 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-11-16 20:29:26 +0100 |
commit | 49abbbbedca83b9031d3e2eb3ae9ad9b6a7d96ed (patch) | |
tree | 68c59d67637a297d513e07ea96ba236a7f0cd43b /server/middlewares/validators | |
parent | 41b5da1d8cb41f5c49f0e0a01a54106c9a5925dd (diff) | |
download | PeerTube-49abbbbedca83b9031d3e2eb3ae9ad9b6a7d96ed.tar.gz PeerTube-49abbbbedca83b9031d3e2eb3ae9ad9b6a7d96ed.tar.zst PeerTube-49abbbbedca83b9031d3e2eb3ae9ad9b6a7d96ed.zip |
Pod URL -> pod host. HTTPS is required to make friends.
Reason: in a network with mix http/https pods, https pods won't be able
to play videos from http pod (insecure requests).
Diffstat (limited to 'server/middlewares/validators')
-rw-r--r-- | server/middlewares/validators/pods.js | 4 | ||||
-rw-r--r-- | server/middlewares/validators/remote.js | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/server/middlewares/validators/pods.js b/server/middlewares/validators/pods.js index fd3d1e2f2..4f8bad2f9 100644 --- a/server/middlewares/validators/pods.js +++ b/server/middlewares/validators/pods.js | |||
@@ -10,7 +10,7 @@ const validatorsPod = { | |||
10 | } | 10 | } |
11 | 11 | ||
12 | function makeFriends (req, res, next) { | 12 | function makeFriends (req, res, next) { |
13 | req.checkBody('urls', 'Should have an array of unique urls').isEachUniqueUrlValid() | 13 | req.checkBody('hosts', 'Should have an array of unique hosts').isEachUniqueHostValid() |
14 | 14 | ||
15 | logger.debug('Checking makeFriends parameters', { parameters: req.body }) | 15 | logger.debug('Checking makeFriends parameters', { parameters: req.body }) |
16 | 16 | ||
@@ -32,7 +32,7 @@ function makeFriends (req, res, next) { | |||
32 | } | 32 | } |
33 | 33 | ||
34 | function podsAdd (req, res, next) { | 34 | function podsAdd (req, res, next) { |
35 | req.checkBody('url', 'Should have an url').notEmpty().isURL({ require_protocol: true }) | 35 | req.checkBody('host', 'Should have an host').notEmpty().isURL() |
36 | req.checkBody('publicKey', 'Should have a public key').notEmpty() | 36 | req.checkBody('publicKey', 'Should have a public key').notEmpty() |
37 | 37 | ||
38 | // TODO: check we don't have it already | 38 | // TODO: check we don't have it already |
diff --git a/server/middlewares/validators/remote.js b/server/middlewares/validators/remote.js index 8c29ef8ca..c6455e678 100644 --- a/server/middlewares/validators/remote.js +++ b/server/middlewares/validators/remote.js | |||
@@ -27,10 +27,10 @@ function remoteVideos (req, res, next) { | |||
27 | } | 27 | } |
28 | 28 | ||
29 | function signature (req, res, next) { | 29 | function signature (req, res, next) { |
30 | req.checkBody('signature.url', 'Should have a signature url').isURL() | 30 | req.checkBody('signature.host', 'Should have a signature host').isURL() |
31 | req.checkBody('signature.signature', 'Should have a signature').notEmpty() | 31 | req.checkBody('signature.signature', 'Should have a signature').notEmpty() |
32 | 32 | ||
33 | logger.debug('Checking signature parameters', { parameters: { signatureUrl: req.body.signature.url } }) | 33 | logger.debug('Checking signature parameters', { parameters: { signatureHost: req.body.signature.host } }) |
34 | 34 | ||
35 | checkErrors(req, res, next) | 35 | checkErrors(req, res, next) |
36 | } | 36 | } |