aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-10-23 11:38:48 +0200
committerChocobozzz <me@florianbigard.com>2018-11-14 16:32:27 +0100
commitdf66d81583e07ce049daeeef1edc6a87b57b3684 (patch)
tree2a12747cd442713807e2b7d93899bc621d303459 /server/middlewares
parentb83b8dd5aef03084133c5983de6f312e7d1654b8 (diff)
downloadPeerTube-df66d81583e07ce049daeeef1edc6a87b57b3684.tar.gz
PeerTube-df66d81583e07ce049daeeef1edc6a87b57b3684.tar.zst
PeerTube-df66d81583e07ce049daeeef1edc6a87b57b3684.zip
Add compatibility with other Linked Signature algorithms
Diffstat (limited to 'server/middlewares')
-rw-r--r--server/middlewares/activitypub.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/middlewares/activitypub.ts b/server/middlewares/activitypub.ts
index 1ec888477..01e5dd24e 100644
--- a/server/middlewares/activitypub.ts
+++ b/server/middlewares/activitypub.ts
@@ -53,7 +53,8 @@ function executeIfActivityPub (fun: RequestHandler | RequestHandler[]) {
53 53
54export { 54export {
55 checkSignature, 55 checkSignature,
56 executeIfActivityPub 56 executeIfActivityPub,
57 checkHttpSignature
57} 58}
58 59
59// --------------------------------------------------------------------------- 60// ---------------------------------------------------------------------------
@@ -94,7 +95,7 @@ async function checkHttpSignature (req: Request, res: Response) {
94async function checkJsonLDSignature (req: Request, res: Response) { 95async function checkJsonLDSignature (req: Request, res: Response) {
95 const signatureObject: ActivityPubSignature = req.body.signature 96 const signatureObject: ActivityPubSignature = req.body.signature
96 97
97 if (!signatureObject.creator) { 98 if (!signatureObject || !signatureObject.creator) {
98 res.sendStatus(403) 99 res.sendStatus(403)
99 return false 100 return false
100 } 101 }