about summary refs log tree commit diff
path: root/config/initializers/rack-attack.rb
blob: fb447685bf00cedd2361fdc9bd669a2ede1e1c24 (plain) (blame)
1
2
3
4
5
6
7
8
9
class Rack::Attack
  throttle('get-req/ip', limit: 300, period: 5.minutes) do |req|
    req.ip if req.get?
  end

  throttle('post-req/ip', limit: 100, period: 5.minutes) do |req|
    req.ip if req.post?
  end
end