Skip to content

Commit

Permalink
Merge pull request #300 from smanolache/master
Browse files Browse the repository at this point in the history
issue 289: ratelimiting plugin: cope with non-atomic increments of ca…
  • Loading branch information
thibaultcha committed Jun 4, 2015
2 parents 4732eac + 96a802f commit b75c416
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kong/plugins/ratelimiting/access.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function _M.execute(conf)
ngx.header[constants.HEADERS.RATELIMIT_LIMIT] = conf.limit
ngx.header[constants.HEADERS.RATELIMIT_REMAINING] = math.max(0, remaining - 1) -- -1 for this current request

if remaining == 0 then
if remaining <= 0 then
ngx.ctx.stop_phases = true -- interrupt other phases of this request
return responses.send(429, "API rate limit exceeded")
end
Expand Down

0 comments on commit b75c416

Please sign in to comment.