refactor: call verify if request is POST

This commit is contained in:
Barış Soner Uşaklı
2025-05-12 10:28:26 -04:00
parent 16504bad81
commit dfa213298b

View File

@@ -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