Node.js based forum software built for the modern web
refactor: call verify if request is POST
Barış Soner Uşaklıdfa213298b7d
diff --git a/src/middleware/activitypub.js b/src/middleware/activitypub.jsindex 490715dbcb..b38caa552a 100644--- a/src/middleware/activitypub.js+++ b/src/middleware/activitypub.js@@ -33,10 +33,12 @@ middleware.verify = async function (req, res, next) {return next();}- const verified = await activitypub.verify(req);- if (!verified && req.method === 'POST') {- activitypub.helpers.log('[middleware/activitypub] HTTP signature verification failed.');- return res.sendStatus(400);+ if (req.method === 'POST') {+ const verified = await activitypub.verify(req);+ if (!verified) {+ activitypub.helpers.log('[middleware/activitypub] HTTP signature verification failed.');+ return res.sendStatus(400);+ }}// Set calling user