1
0
Fork 1
mirror of https://github.com/dariusk/express-activitypub.git synced 2025-03-13 08:42:41 +00:00

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.
This commit is contained in:
Darius Kazemi 2025-03-02 18:55:28 -08:00 committed by GitHub
parent 612e316345
commit 0605621b2f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);
}
});