aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/secure.ts
diff options
context:
space:
mode:
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 = {