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
Darius Kazemi 2025-03-02 18:55:28 -08:00 zatwierdzone przez GitHub
rodzic 612e316345
commit 0605621b2f
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

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