mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: save modified actor back to req.body
This commit is contained in:
@@ -48,14 +48,16 @@ middleware.validate = async function (req, res, next) {
|
|||||||
}
|
}
|
||||||
winston.verbose('[middleware/activitypub] Request body check passed.');
|
winston.verbose('[middleware/activitypub] Request body check passed.');
|
||||||
|
|
||||||
const { actor, object } = req.body;
|
let { actor, object } = req.body;
|
||||||
|
|
||||||
// Actor normalization
|
// Actor normalization
|
||||||
if (typeof actor === 'object' && actor.hasOwnProperty('id')) {
|
if (typeof actor === 'object' && actor.hasOwnProperty('id')) {
|
||||||
req.body.actor = actor.id;
|
actor = actor.id;
|
||||||
|
req.body.actor = actor;
|
||||||
}
|
}
|
||||||
if (Array.isArray(actor)) {
|
if (Array.isArray(actor)) {
|
||||||
req.body.actor = actor.map(a => (typeof a === 'string' ? a : a.id));
|
actor = actor.map(a => (typeof a === 'string' ? a : a.id));
|
||||||
|
req.body.actor = actor;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Origin checking
|
// Origin checking
|
||||||
|
|||||||
Reference in New Issue
Block a user