Skip to content

Commit

Permalink
refactor: append links instead of restting previous one
Browse files Browse the repository at this point in the history
Respect previously added links as this header can be used by other
components
  • Loading branch information
thedevsaddam committed Sep 4, 2023
1 parent 835c2f1 commit 1edced1
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions middleware/sunset.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ func Sunset(sunsetAt time.Time, links ...string) func(http.Handler) http.Handler
w.Header().Set("Sunset", sunsetAt.Format(http.TimeFormat))
w.Header().Set("Deprecation", sunsetAt.Format(http.TimeFormat))

for i, link := range links {
if i == 0 {
w.Header().Set("Link", link)
continue
}
for _, link := range links {
w.Header().Add("Link", link)
}
}
Expand Down

0 comments on commit 1edced1

Please sign in to comment.