kopia lustrzana https://github.com/dariusk/express-activitypub
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.master
rodzic
612e316345
commit
0605621b2f
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
|
Ładowanie…
Reference in New Issue