mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-05 07:10:30 +01:00
fix: missing req.body when parsing ActivityPub requests
This commit is contained in:
@@ -194,6 +194,9 @@ ActivityPub.send = async (uid, targets, payload) => {
|
||||
resolveWithFullResponse: true,
|
||||
});
|
||||
|
||||
console.log(response.statusCode, response.body);
|
||||
if (response.statusCode !== 201) {
|
||||
// todo: i18n this
|
||||
throw new Error('activity-failed');
|
||||
}
|
||||
}));
|
||||
};
|
||||
|
||||
@@ -99,7 +99,7 @@ Controller.getInbox = async (req, res) => {
|
||||
};
|
||||
|
||||
Controller.postInbox = async (req, res) => {
|
||||
console.log(req.body);
|
||||
console.log('received', req.body);
|
||||
|
||||
res.sendStatus(201);
|
||||
};
|
||||
|
||||
@@ -229,7 +229,13 @@ function configureBodyParser(app) {
|
||||
}
|
||||
app.use(bodyParser.urlencoded(urlencodedOpts));
|
||||
|
||||
const jsonOpts = nconf.get('bodyParser:json') || {};
|
||||
const jsonOpts = nconf.get('bodyParser:json') || {
|
||||
type: [
|
||||
'application/json',
|
||||
'application/ld+json',
|
||||
'application/activity+json',
|
||||
],
|
||||
};
|
||||
app.use(bodyParser.json(jsonOpts));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user