Skip to content

Commit

Permalink
fix response rate limit check condition
Browse files Browse the repository at this point in the history
  • Loading branch information
narendrapatel committed Oct 30, 2024
1 parent 13fb553 commit f5c4306
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kong/plugins/response-ratelimiting/access.lua
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function _M.execute(conf)
for k in pairs(conf.limits) do
local remaining
for _, lv in pairs(usage[k]) do
if conf.block_on_first_violation and lv.remaining == 0 then
if conf.block_on_first_violation and lv.remaining <= 0 then
return kong.response.error(HTTP_TOO_MANY_REQUESTS,
"API rate limit exceeded for '" .. k .. "'")
end
Expand Down

0 comments on commit f5c4306

Please sign in to comment.