From f5c4306b6eaeebc15eee17a10412b43df2291aac Mon Sep 17 00:00:00 2001 From: Narendra Patel Date: Wed, 30 Oct 2024 18:28:50 +0530 Subject: [PATCH] fix response rate limit check condition --- kong/plugins/response-ratelimiting/access.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kong/plugins/response-ratelimiting/access.lua b/kong/plugins/response-ratelimiting/access.lua index 5f5a2328122d..77914a97e065 100644 --- a/kong/plugins/response-ratelimiting/access.lua +++ b/kong/plugins/response-ratelimiting/access.lua @@ -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