aboutsummaryrefslogtreecommitdiff
path: root/http/server.go
diff options
context:
space:
mode:
Diffstat (limited to 'http/server.go')
-rw-r--r--http/server.go13
1 files changed, 5 insertions, 8 deletions
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)