diff options
Diffstat (limited to 'server/helpers/requests.js')
-rw-r--r-- | server/helpers/requests.js | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/server/helpers/requests.js b/server/helpers/requests.js index 06109ce16..b0cda09fe 100644 --- a/server/helpers/requests.js +++ b/server/helpers/requests.js | |||
@@ -44,21 +44,8 @@ function makeSecureRequest (params, callback) { | |||
44 | 44 | ||
45 | // If there are data informations | 45 | // If there are data informations |
46 | if (params.data) { | 46 | if (params.data) { |
47 | // Encrypt data | 47 | requestParams.json.data = params.data |
48 | if (params.encrypt === true) { | 48 | request.post(requestParams, callback) |
49 | peertubeCrypto.encrypt(params.toPod.publicKey, JSON.stringify(params.data), function (err, encrypted) { | ||
50 | if (err) return callback(err) | ||
51 | |||
52 | requestParams.json.data = encrypted.data | ||
53 | requestParams.json.key = encrypted.key | ||
54 | |||
55 | request.post(requestParams, callback) | ||
56 | }) | ||
57 | } else { | ||
58 | // No encryption | ||
59 | requestParams.json.data = params.data | ||
60 | request.post(requestParams, callback) | ||
61 | } | ||
62 | } else { | 49 | } else { |
63 | // No data | 50 | // No data |
64 | request.post(requestParams, callback) | 51 | request.post(requestParams, callback) |