From f1565865080c0e7fbd4ce5731cc5bf812a8f4b7b Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Thu, 10 Oct 2019 12:31:49 -0400 Subject: [PATCH] Fix /ap/actor not redirecting to home page in browsers Fixes #1 --- lib/activitypub/actor.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/activitypub/actor.ts b/lib/activitypub/actor.ts index cc9266f..8f69787 100644 --- a/lib/activitypub/actor.ts +++ b/lib/activitypub/actor.ts @@ -29,12 +29,12 @@ export default async function actor(router: Router) { }; router.get("/ap/actor", (req, res) => { - if (req.accepts("application/activity+json")) { + if (req.accepts("text/html")) { + res.redirect("/"); + } else { res.type("application/activity+json"); res.json(actorObj); res.end(); - } else { - res.redirect("/"); } }); -} \ No newline at end of file +}