From 9027aba0621018caf177611d9105213645efe491 Mon Sep 17 00:00:00 2001 From: Julio Capote Date: Mon, 2 Jan 2023 09:32:41 -0500 Subject: fix webfinger --- http/router.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'http/router.go') diff --git a/http/router.go b/http/router.go index f763c79..d5d0de5 100644 --- a/http/router.go +++ b/http/router.go @@ -37,28 +37,30 @@ func (s *Router) Start(zapWriter io.Writer) { // Webfinger router.GET("/.well-known/webfinger", func(c *gin.Context) { resourceParam := c.Query("resource") - resource, _ := s.registry.WebfingerResource(resourceParam) + resource, _ := s.registry.Webfinger(resourceParam) if resource != nil { c.JSON(http.StatusOK, resource) } else { - c.JSON(http.StatusNotFound, nil) + c.JSON(http.StatusNotFound, map[string]interface{}{}) } }) - // "User" endpoint + // Actor router.GET("/actors/:actor", func(c *gin.Context) { actorParam := c.Param("actor") resource, err := s.registry.Actor(actorParam) render(c, resource, err) }) + // Actor Followers router.GET("/actors/:actor/followers", func(c *gin.Context) { actorParam := c.Param("actor") resource, err := s.registry.Followers(actorParam) render(c, resource, err) }) + // Actor Following router.GET("/actors/:actor/following", func(c *gin.Context) { actorParam := c.Param("actor") resource, err := s.registry.Following(actorParam) @@ -77,7 +79,7 @@ func (s *Router) Start(zapWriter io.Writer) { // }) - // Outbox + // Actor Outbox router.GET("/actors/:actor/outbox", func(c *gin.Context) { actorParam := c.Param("actor") var resource map[string]interface{} @@ -90,7 +92,7 @@ func (s *Router) Start(zapWriter io.Writer) { render(c, resource, err) }) - // Single activity + // Actor Activity router.GET("/actors/:actor/activity/:id", func(c *gin.Context) { actorParam := c.Param("actor") idParam := c.Param("id") @@ -98,7 +100,7 @@ func (s *Router) Start(zapWriter io.Writer) { render(c, resource, err) }) - // Single note + // Activity Note router.GET("/actors/:actor/activity/:id/note", func(c *gin.Context) { actorParam := c.Param("actor") idParam := c.Param("id") -- cgit v1.2.3