summaryrefslogtreecommitdiff
path: root/internal/api/client/timeline
diff options
context:
space:
mode:
Diffstat (limited to 'internal/api/client/timeline')
-rw-r--r--internal/api/client/timeline/home.go4
-rw-r--r--internal/api/client/timeline/public.go9
2 files changed, 9 insertions, 4 deletions
diff --git a/internal/api/client/timeline/home.go b/internal/api/client/timeline/home.go
index 86606a0dd..cb72895f9 100644
--- a/internal/api/client/timeline/home.go
+++ b/internal/api/client/timeline/home.go
@@ -94,6 +94,8 @@ func (m *Module) HomeTimelineGETHandler(c *gin.Context) {
return
}
- c.Header("Link", resp.LinkHeader)
+ if resp.LinkHeader != "" {
+ c.Header("Link", resp.LinkHeader)
+ }
c.JSON(http.StatusOK, resp.Statuses)
}
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)
}