From c500a2be38afcbb5688537d97c7c3ee30a57dba4 Mon Sep 17 00:00:00 2001 From: Julio Capote Date: Fri, 30 Dec 2022 21:20:02 -0500 Subject: parse and persist feeds from handlers --- http/server.go | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'http/server.go') diff --git a/http/server.go b/http/server.go index 78d916c..98b4083 100644 --- a/http/server.go +++ b/http/server.go @@ -62,17 +62,14 @@ func (s *Server) Start(zapWriter io.Writer) { // Outbox router.GET("/actors/:actor/outbox", func(c *gin.Context) { actorParam := c.Param("actor") - var found bool + var resource map[string]interface{} if c.Query("page") == "true" { - resource, _ := s.registry.OutboxCollection(actorParam) - c.String(http.StatusOK, resource) - found = true + resource, _ = s.registry.OutboxCollection(actorParam) } else { - resource, _ := s.registry.Outbox(actorParam) - c.JSON(http.StatusOK, resource) - found = true + resource, _ = s.registry.Outbox(actorParam) } - if found { + if resource != nil { + c.JSON(http.StatusOK, resource) c.Writer.Header().Set("Content-Type", "application/activity+json") } else { c.JSON(http.StatusNotFound, nil) -- cgit v1.2.3