Skip to content

Commit

Permalink
add missing 429 status check before log
Browse files Browse the repository at this point in the history
  • Loading branch information
hernan committed Jan 17, 2025
1 parent 362ab56 commit 727c4d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ratelimiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (r *Ratelimiter) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
_, _ = fmt.Fprintf(os.Stderr, "ratelimiter middleware: dry run: too many requests\n")
}

if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusAccepted && resp.StatusCode != http.StatusNoContent {
if resp.StatusCode != http.StatusTooManyRequests && resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusAccepted && resp.StatusCode != http.StatusNoContent {
_, _ = fmt.Fprintf(os.Stderr, "ratelimiter middleware: unexpected status code: %d\n", resp.StatusCode)
}

Expand Down

0 comments on commit 727c4d2

Please sign in to comment.