Configure Rack::Attack
This commit is contained in:
parent
64b488e7d6
commit
d3b24b8e66
1 changed files with 5 additions and 1 deletions
|
@ -2,4 +2,8 @@
|
||||||
|
|
||||||
# Be sure to restart your server when you modify this file.
|
# Be sure to restart your server when you modify this file.
|
||||||
|
|
||||||
Rack::Attack.throttle 'requests by IP', limit: 10, period: 1, &:ip
|
Rack::Attack.throttle 'req/ip', limit: 120, period: 60, &:ip
|
||||||
|
|
||||||
|
Rack::Attack.throttle 'user/email', limit: 20, period: 60 do |req|
|
||||||
|
req.params['email'].presence if req.post? && req.path.start_with?('/users')
|
||||||
|
end
|
||||||
|
|
Reference in a new issue