Skip to content

Commit

Permalink
Avoid setting X-RateLimit-Remaining header twice (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
VojtechVitek authored Jul 24, 2024
1 parent fb7d30a commit 41014cd
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion limiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ func (l *rateLimiter) Handler(next http.Handler) http.Handler {
limit = val
}
w.Header().Set("X-RateLimit-Limit", fmt.Sprintf("%d", limit))
w.Header().Set("X-RateLimit-Remaining", fmt.Sprintf("%d", 0))
w.Header().Set("X-RateLimit-Reset", fmt.Sprintf("%d", currentWindow.Add(l.windowLength).Unix()))

l.mu.Lock()
Expand Down

0 comments on commit 41014cd

Please sign in to comment.