From 4b001f3f748cfb3a41672120c102c133dfef01ce Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Sun, 22 May 2022 16:09:43 -0700 Subject: delete posts working --- route/routes/actor.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'route/routes/actor.go') diff --git a/route/routes/actor.go b/route/routes/actor.go index e27133b..e1372ee 100644 --- a/route/routes/actor.go +++ b/route/routes/actor.go @@ -21,6 +21,7 @@ import ( func ActorInbox(ctx *fiber.Ctx) error { activity, err := activitypub.GetActivityFromJson(ctx) + if err != nil { return util.MakeError(err, "ActorInbox") } @@ -380,8 +381,8 @@ func ActorPost(ctx *fiber.Ctx) error { } func ActorPostGet(ctx *fiber.Ctx) error { - actor, err := activitypub.GetActorByNameFromDB(ctx.Params("actor")) + if err != nil { return nil } @@ -428,8 +429,9 @@ func ActorPostGet(ctx *fiber.Ctx) error { } else { obj := activitypub.ObjectBase{Id: inReplyTo} collection, err := obj.GetCollectionFromPath() + if err != nil { - return util.MakeError(err, "PostGet") + return ctx.Status(404).Render("404", fiber.Map{}) } if collection.Actor.Id != "" { @@ -560,7 +562,7 @@ func ActorOutboxGet(ctx *fiber.Ctx) error { actor, err := activitypub.GetActorByNameFromDB(ctx.Params("actor")) if err != nil { - return nil + return ctx.Status(404).Render("404", fiber.Map{}) } if activitypub.AcceptActivity(ctx.Get("Accept")) { -- cgit v1.2.3