Skip to content

Commit

Permalink
move header up
Browse files Browse the repository at this point in the history
  • Loading branch information
klaidliadon committed Sep 20, 2024
1 parent 37be242 commit 8d182db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion limiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ func (l *RateLimiter) OnLimit(w http.ResponseWriter, r *http.Request, key string
if !ok {
limit = l.requestLimit
}
setHeader(w, l.headers.Reset, fmt.Sprintf("%d", currentWindow.Add(l.windowLength).Unix()))
setHeader(w, l.headers.Limit, fmt.Sprintf("%d", limit))
setHeader(w, l.headers.Reset, fmt.Sprintf("%d", currentWindow.Add(l.windowLength).Unix()))

// If the limit is set to 0, we always limit
if limit == 0 {
Expand Down

0 comments on commit 8d182db

Please sign in to comment.