aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/secure.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-05-22 20:58:25 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-05-25 17:32:16 +0200
commite02643f32e4c97ca307f8fc5b69be79c40d70a3b (patch)
treeb7f6269913cd5a0e4f26a9461a043deb0c168be0 /server/middlewares/secure.ts
parent65fcc3119c334b75dd13bcfdebf186afdc580a8f (diff)
downloadPeerTube-e02643f32e4c97ca307f8fc5b69be79c40d70a3b.tar.gz
PeerTube-e02643f32e4c97ca307f8fc5b69be79c40d70a3b.tar.zst
PeerTube-e02643f32e4c97ca307f8fc5b69be79c40d70a3b.zip
Type models
Diffstat (limited to 'server/middlewares/secure.ts')
-rw-r--r--server/middlewares/secure.ts10
1 files changed, 6 insertions, 4 deletions
diff --git a/server/middlewares/secure.ts b/server/middlewares/secure.ts
index ee8545028..bd7cfa918 100644
--- a/server/middlewares/secure.ts
+++ b/server/middlewares/secure.ts
@@ -1,6 +1,8 @@
1const db = require('../initializers/database') 1import { database as db } from '../initializers'
2const logger = require('../helpers/logger') 2import {
3const peertubeCrypto = require('../helpers/peertube-crypto') 3 logger,
4 checkSignature as peertubeCryptoCheckSignature
5} from '../helpers'
4 6
5function checkSignature (req, res, next) { 7function checkSignature (req, res, next) {
6 const host = req.body.signature.host 8 const host = req.body.signature.host
@@ -26,7 +28,7 @@ function checkSignature (req, res, next) {
26 signatureShouldBe = host 28 signatureShouldBe = host
27 } 29 }
28 30
29 const signatureOk = peertubeCrypto.checkSignature(pod.publicKey, signatureShouldBe, req.body.signature.signature) 31 const signatureOk = peertubeCryptoCheckSignature(pod.publicKey, signatureShouldBe, req.body.signature.signature)
30 32
31 if (signatureOk === true) { 33 if (signatureOk === true) {
32 res.locals.secure = { 34 res.locals.secure = {