mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: add basic sanity-checking to middleware.validateActivity
This commit is contained in:
@@ -338,5 +338,11 @@ middleware.validateActivity = helpers.try(async (req, res, next) => {
|
||||
return res.sendStatus(400);
|
||||
}
|
||||
|
||||
// Sanity-check payload schema
|
||||
const required = ['type'];
|
||||
if (!required.every(prop => req.body.hasOwnProperty(prop))) {
|
||||
return res.sendStatus(400);
|
||||
}
|
||||
|
||||
next();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user