0
0
Fork 0

Apply a 25x rate limit by IP even to authenticated requests (#5948)

This commit is contained in:
Eugen Rochko 2017-12-11 15:32:29 +01:00 committed by GitHub
parent e56323a4dd
commit feed07227b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -44,8 +44,8 @@ module RateLimitHeaders
end
def api_throttle_data
request.env['rack.attack.throttle_data']['throttle_authenticated_api'] ||
request.env['rack.attack.throttle_data']['throttle_unauthenticated_api']
most_limited_type, = request.env['rack.attack.throttle_data'].min_by { |_, v| v[:limit] }
request.env['rack.attack.throttle_data'][most_limited_type]
end
def request_time