Skip to content

Commit

Permalink
fix: skip ratelimiter for OPTIONS
Browse files Browse the repository at this point in the history
  • Loading branch information
totegamma committed Oct 20, 2024
1 parent 6f595da commit 6302fb5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions x/auth/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit 6302fb5

Please sign in to comment.