mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
refactor: call verify if request is POST
This commit is contained in:
@@ -33,10 +33,12 @@ middleware.verify = async function (req, res, next) {
|
|||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
|
|
||||||
const verified = await activitypub.verify(req);
|
if (req.method === 'POST') {
|
||||||
if (!verified && req.method === 'POST') {
|
const verified = await activitypub.verify(req);
|
||||||
activitypub.helpers.log('[middleware/activitypub] HTTP signature verification failed.');
|
if (!verified) {
|
||||||
return res.sendStatus(400);
|
activitypub.helpers.log('[middleware/activitypub] HTTP signature verification failed.');
|
||||||
|
return res.sendStatus(400);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set calling user
|
// Set calling user
|
||||||
|
|||||||
Reference in New Issue
Block a user