From bc503c2a62dcf9aed6b8d90b68f0f27a7755ac01 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 11 May 2016 21:19:34 +0200 Subject: Update to standard 7. Goodbye snake_case, I used to love you --- server/middlewares/reqValidators/pods.js | 4 ++-- server/middlewares/reqValidators/utils.js | 6 +++--- server/middlewares/secure.js | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'server/middlewares') diff --git a/server/middlewares/reqValidators/pods.js b/server/middlewares/reqValidators/pods.js index 45e34c1ab..77449480c 100644 --- a/server/middlewares/reqValidators/pods.js +++ b/server/middlewares/reqValidators/pods.js @@ -10,13 +10,13 @@ const reqValidatorsPod = { } function makeFriends (req, res, next) { - friends.hasFriends(function (err, has_friends) { + friends.hasFriends(function (err, hasFriends) { if (err) { logger.error('Cannot know if we have friends.', { error: err }) res.sendStatus(500) } - if (has_friends === true) { + if (hasFriends === true) { // We need to quit our friends before make new ones res.sendStatus(409) } else { diff --git a/server/middlewares/reqValidators/utils.js b/server/middlewares/reqValidators/utils.js index 05675c445..198ed8d26 100644 --- a/server/middlewares/reqValidators/utils.js +++ b/server/middlewares/reqValidators/utils.js @@ -8,13 +8,13 @@ const reqValidatorsUtils = { checkErrors: checkErrors } -function checkErrors (req, res, next, status_code) { - if (status_code === undefined) status_code = 400 +function checkErrors (req, res, next, statusCode) { + if (statusCode === undefined) statusCode = 400 const errors = req.validationErrors() if (errors) { logger.warn('Incorrect request parameters', { path: req.originalUrl, err: errors }) - return res.status(status_code).send('There have been validation errors: ' + util.inspect(errors)) + return res.status(statusCode).send('There have been validation errors: ' + util.inspect(errors)) } return next() diff --git a/server/middlewares/secure.js b/server/middlewares/secure.js index 9ecbf5df1..ad7b0fbf7 100644 --- a/server/middlewares/secure.js +++ b/server/middlewares/secure.js @@ -23,9 +23,9 @@ function decryptBody (req, res, next) { logger.debug('Decrypting body from %s.', url) - const signature_ok = peertubeCrypto.checkSignature(pod.publicKey, url, req.body.signature.signature) + const signatureOk = peertubeCrypto.checkSignature(pod.publicKey, url, req.body.signature.signature) - if (signature_ok === true) { + if (signatureOk === true) { peertubeCrypto.decrypt(req.body.key, req.body.data, function (err, decrypted) { if (err) { logger.error('Cannot decrypt data.', { error: err }) -- cgit v1.2.3