content type

This commit is contained in:
Madeline
2023-08-14 14:05:36 +10:00
parent f90b9729f9
commit e011a2ce3e
2 changed files with 8 additions and 0 deletions
+7
View File
@@ -50,6 +50,13 @@ export class APServer extends Server {
this.app = app;
this.app.use("*", (req, res, next) => {
res.setHeader(
"Content-Type",
"application/activity+json; charset=utf-8",
);
next();
});
this.app.use("/fed", api);
this.app.get("/fed", (req, res) => {
res.json({ ping: "pong" });
+1
View File
@@ -48,6 +48,7 @@ router.get(
const type = found instanceof Channel ? "channel" : "user";
res.setHeader("Content-Type", "application/jrd+json; charset=utf-8");
return res.json({
subject: `acct:${resourceId}@${webDomain}`, // mastodon always returns acct so might as well
aliases: [`https://${webDomain}/fed/${type}/${resourceId}`],