diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-05-22 20:58:25 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-05-25 17:32:16 +0200 |
commit | e02643f32e4c97ca307f8fc5b69be79c40d70a3b (patch) | |
tree | b7f6269913cd5a0e4f26a9461a043deb0c168be0 /server/middlewares/secure.ts | |
parent | 65fcc3119c334b75dd13bcfdebf186afdc580a8f (diff) | |
download | PeerTube-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.ts | 10 |
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 @@ | |||
1 | const db = require('../initializers/database') | 1 | import { database as db } from '../initializers' |
2 | const logger = require('../helpers/logger') | 2 | import { |
3 | const peertubeCrypto = require('../helpers/peertube-crypto') | 3 | logger, |
4 | checkSignature as peertubeCryptoCheckSignature | ||
5 | } from '../helpers' | ||
4 | 6 | ||
5 | function checkSignature (req, res, next) { | 7 | function 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 = { |