From 0c8c34d81d6cb3d741760ffffef8662e7204184f Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Thu, 26 Dec 2024 23:37:54 -0500 Subject: [PATCH] http: Don't add rate limit entries for things that aren't limited --- http/handler.go | 1 + 1 file changed, 1 insertion(+) diff --git a/http/handler.go b/http/handler.go index 02b93e0..adeb252 100644 --- a/http/handler.go +++ b/http/handler.go @@ -337,6 +337,7 @@ func (this *Handler) logErr (name string, err error) { } func (this *Handler) rateLimit (req *http.Request, resource string, duration time.Duration) error { + if duration == 0 { return nil } host, _, _ := net.SplitHostPort(req.RemoteAddr) key := fmt.Sprintf("%s|%s", host, resource) table, done := this.rateLimitMap.Borrow()