diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-03-16 22:29:27 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-03-16 22:29:27 +0100 |
commit | f0f5567b6918fc60c8cab15e13aec03a89a91dfb (patch) | |
tree | 99dfdb9fa8273c9cda1360fd3b6bfccc515bf8be /server/middlewares/secure.js | |
parent | 5101105ef91bfe478f97546b78b321882da2079c (diff) | |
download | PeerTube-f0f5567b6918fc60c8cab15e13aec03a89a91dfb.tar.gz PeerTube-f0f5567b6918fc60c8cab15e13aec03a89a91dfb.tar.zst PeerTube-f0f5567b6918fc60c8cab15e13aec03a89a91dfb.zip |
Use const/let now we use node 4.2
Diffstat (limited to 'server/middlewares/secure.js')
-rw-r--r-- | server/middlewares/secure.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/server/middlewares/secure.js b/server/middlewares/secure.js index bfd28316a..9ecbf5df1 100644 --- a/server/middlewares/secure.js +++ b/server/middlewares/secure.js | |||
@@ -1,15 +1,15 @@ | |||
1 | 'use strict' | 1 | 'use strict' |
2 | 2 | ||
3 | var logger = require('../helpers/logger') | 3 | const logger = require('../helpers/logger') |
4 | var peertubeCrypto = require('../helpers/peertubeCrypto') | 4 | const peertubeCrypto = require('../helpers/peertubeCrypto') |
5 | var Pods = require('../models/pods') | 5 | const Pods = require('../models/pods') |
6 | 6 | ||
7 | var secureMiddleware = { | 7 | const secureMiddleware = { |
8 | decryptBody: decryptBody | 8 | decryptBody: decryptBody |
9 | } | 9 | } |
10 | 10 | ||
11 | function decryptBody (req, res, next) { | 11 | function decryptBody (req, res, next) { |
12 | var url = req.body.signature.url | 12 | const url = req.body.signature.url |
13 | Pods.findByUrl(url, function (err, pod) { | 13 | Pods.findByUrl(url, function (err, pod) { |
14 | if (err) { | 14 | if (err) { |
15 | logger.error('Cannot get signed url in decryptBody.', { error: err }) | 15 | logger.error('Cannot get signed url in decryptBody.', { error: err }) |
@@ -23,7 +23,7 @@ function decryptBody (req, res, next) { | |||
23 | 23 | ||
24 | logger.debug('Decrypting body from %s.', url) | 24 | logger.debug('Decrypting body from %s.', url) |
25 | 25 | ||
26 | var signature_ok = peertubeCrypto.checkSignature(pod.publicKey, url, req.body.signature.signature) | 26 | const signature_ok = peertubeCrypto.checkSignature(pod.publicKey, url, req.body.signature.signature) |
27 | 27 | ||
28 | if (signature_ok === true) { | 28 | if (signature_ok === true) { |
29 | peertubeCrypto.decrypt(req.body.key, req.body.data, function (err, decrypted) { | 29 | peertubeCrypto.decrypt(req.body.key, req.body.data, function (err, decrypted) { |