From 0605621b2fa48ecbb9cf815544a9e16bf3faa439 Mon Sep 17 00:00:00 2001 From: Darius Kazemi Date: Sun, 2 Mar 2025 18:55:28 -0800 Subject: [PATCH] Update user.js Mastodon rejects messages that are "application/json" mime type, which is the default for a .json() call in Express. Have to add the "application/activity+json" Content-Type instead. --- routes/user.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/routes/user.js b/routes/user.js index f62c2a1..3c34910 100644 --- a/routes/user.js +++ b/routes/user.js @@ -23,6 +23,7 @@ router.get('/:name', function (req, res) { if (tempActor.followers === undefined) { tempActor.followers = `https://${domain}/u/${username}/followers`; } + res.set('Content-Type', 'application/activity+json'); res.json(tempActor); } } @@ -53,6 +54,7 @@ router.get('/:name/followers', function (req, res) { }, "@context":["https://www.w3.org/ns/activitystreams"] }; + res.set('Content-Type', 'application/activity+json'); res.json(followersCollection); } }); @@ -78,6 +80,7 @@ router.get('/:name/outbox', function (req, res) { }, "@context":["https://www.w3.org/ns/activitystreams"] }; + res.set('Content-Type', 'application/activity+json'); res.json(outboxCollection); } });