From 6302fb55727f9c7b77909cd2d46abf7cc61e29c8 Mon Sep 17 00:00:00 2001 From: totegamma Date: Mon, 21 Oct 2024 03:22:59 +0900 Subject: [PATCH] fix: skip ratelimiter for OPTIONS --- x/auth/middleware.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/x/auth/middleware.go b/x/auth/middleware.go index 63bc3361..f78f233c 100644 --- a/x/auth/middleware.go +++ b/x/auth/middleware.go @@ -523,6 +523,11 @@ func (s *service) RateLimiter(configMap core.RateLimitConfigMap) echo.Middleware ctx := c.Request().Context() path := resolvePath(c) + // Skip rate limiting for OPTIONS requests + if c.Request().Method == "OPTIONS" { + return next(c) + } + config, ok := configMap[path] if !ok { config = configMap["DEFAULT"]