aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/requests.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-11-14 20:03:04 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-11-16 20:29:26 +0100
commit49abbbbedca83b9031d3e2eb3ae9ad9b6a7d96ed (patch)
tree68c59d67637a297d513e07ea96ba236a7f0cd43b /server/helpers/requests.js
parent41b5da1d8cb41f5c49f0e0a01a54106c9a5925dd (diff)
downloadPeerTube-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/helpers/requests.js')
-rw-r--r--server/helpers/requests.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/server/helpers/requests.js b/server/helpers/requests.js
index 95775c981..06109ce16 100644
--- a/server/helpers/requests.js
+++ b/server/helpers/requests.js
@@ -25,7 +25,7 @@ function makeRetryRequest (params, callback) {
25 25
26function makeSecureRequest (params, callback) { 26function makeSecureRequest (params, callback) {
27 const requestParams = { 27 const requestParams = {
28 url: params.toPod.url + params.path 28 url: constants.REMOTE_SCHEME.HTTP + '://' + params.toPod.host + params.path
29 } 29 }
30 30
31 // Add data with POST requst ? 31 // Add data with POST requst ?
@@ -34,9 +34,11 @@ function makeSecureRequest (params, callback) {
34 34
35 // Add signature if it is specified in the params 35 // Add signature if it is specified in the params
36 if (params.sign === true) { 36 if (params.sign === true) {
37 const host = constants.CONFIG.WEBSERVER.HOST
38
37 requestParams.json.signature = { 39 requestParams.json.signature = {
38 url: constants.CONFIG.WEBSERVER.URL, 40 host,
39 signature: peertubeCrypto.sign(constants.CONFIG.WEBSERVER.URL) 41 signature: peertubeCrypto.sign(host)
40 } 42 }
41 } 43 }
42 44