From 8ef2b9bd7201337a826b63b1c376f5d7b8987ff4 Mon Sep 17 00:00:00 2001 From: Andrew Pietila Date: Sat, 25 Mar 2023 12:52:00 -0500 Subject: [PATCH] Ensure that we have the proper context for JSON-LD manipulation in DB. --- routes/inbox.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/routes/inbox.js b/routes/inbox.js index c45e915..005e422 100644 --- a/routes/inbox.js +++ b/routes/inbox.js @@ -28,7 +28,11 @@ module.exports = { origin: bodyParsed.object.attributedTo, to: JSON.stringify(to), cc: JSON.stringify(cc), - object: JSON.stringify(bodyParsed.object) + object: JSON.stringify( + await jsonld.compact( + await jsonld.expand(bodyParsed)[0]['https://www.w3.org/ns/activitystreams#object'], 'https://www.w3.org/ns/activitystreams' + ) + ) }); res.status(204); res.end();