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,11 +33,13 @@ middleware.verify = async function (req, res, next) {
|
||||
return next();
|
||||
}
|
||||
|
||||
if (req.method === 'POST') {
|
||||
const verified = await activitypub.verify(req);
|
||||
if (!verified && req.method === 'POST') {
|
||||
if (!verified) {
|
||||
activitypub.helpers.log('[middleware/activitypub] HTTP signature verification failed.');
|
||||
return res.sendStatus(400);
|
||||
}
|
||||
}
|
||||
|
||||
// Set calling user
|
||||
if (req.headers.signature) {
|
||||
|
||||
Reference in New Issue
Block a user