diff options
Diffstat (limited to 'http')
-rw-r--r-- | http/server.go | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/http/server.go b/http/server.go index b02e5c9..78d916c 100644 --- a/http/server.go +++ b/http/server.go @@ -62,15 +62,18 @@ func (s *Server) Start(zapWriter io.Writer) { // Outbox router.GET("/actors/:actor/outbox", func(c *gin.Context) { actorParam := c.Param("actor") - var resource map[string]interface{} + var found bool if c.Query("page") == "true" { - resource, _ = s.registry.OutboxPage(actorParam) + resource, _ := s.registry.OutboxCollection(actorParam) + c.String(http.StatusOK, resource) + found = true } else { - resource, _ = s.registry.Outbox(actorParam) + resource, _ := s.registry.Outbox(actorParam) + c.JSON(http.StatusOK, resource) + found = true } - if resource != nil { + if found { c.Writer.Header().Set("Content-Type", "application/activity+json") - c.JSON(http.StatusOK, resource) } else { c.JSON(http.StatusNotFound, nil) } |