From c7da64922f8b41daaee1cb8fc2961f7fa1336737 Mon Sep 17 00:00:00 2001 From: Tobi Smethurst <31960611+tsmethurst@users.noreply.github.com> Date: Fri, 9 Jul 2021 18:32:48 +0200 Subject: favourites GET implementation (#95) --- internal/api/client/timeline/public.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'internal/api/client/timeline/public.go') diff --git a/internal/api/client/timeline/public.go b/internal/api/client/timeline/public.go index f4b233064..6898d781b 100644 --- a/internal/api/client/timeline/public.go +++ b/internal/api/client/timeline/public.go @@ -81,12 +81,15 @@ func (m *Module) PublicTimelineGETHandler(c *gin.Context) { local = i } - statuses, errWithCode := m.processor.PublicTimelineGet(authed, maxID, sinceID, minID, limit, local) + resp, errWithCode := m.processor.PublicTimelineGet(authed, maxID, sinceID, minID, limit, local) if errWithCode != nil { - l.Debugf("error from processor account statuses get: %s", errWithCode) + l.Debugf("error from processor PublicTimelineGet: %s", errWithCode) c.JSON(errWithCode.Code(), gin.H{"error": errWithCode.Safe()}) return } - c.JSON(http.StatusOK, statuses) + if resp.LinkHeader != "" { + c.Header("Link", resp.LinkHeader) + } + c.JSON(http.StatusOK, resp.Statuses) } -- cgit v1.2.3