summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/activitypub/Server.ts7
-rw-r--r--src/activitypub/webfinger/index.ts1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/activitypub/Server.ts b/src/activitypub/Server.ts

index 492d43b6..c497d2e6 100644 --- a/src/activitypub/Server.ts +++ b/src/activitypub/Server.ts
@@ -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" }); diff --git a/src/activitypub/webfinger/index.ts b/src/activitypub/webfinger/index.ts
index 0b82e103..f1b49624 100644 --- a/src/activitypub/webfinger/index.ts +++ b/src/activitypub/webfinger/index.ts
@@ -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}`],