From 727c4d269c67273d1cb23d67fb7a2292eda50c98 Mon Sep 17 00:00:00 2001 From: hernan Date: Fri, 17 Jan 2025 14:17:16 -0300 Subject: [PATCH] add missing 429 status check before log --- ratelimiter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ratelimiter.go b/ratelimiter.go index e21552c..abc622a 100644 --- a/ratelimiter.go +++ b/ratelimiter.go @@ -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) }