Skip to content

Commit

Permalink
Merge pull request #1351 from rubymonsters/1346-refine-rack-attack-se…
Browse files Browse the repository at this point in the history
…ttings

Reduce requests to 1 per second per IP
  • Loading branch information
zaziemo authored Feb 22, 2024
2 parents ceb1651 + 41e68c0 commit 94dddeb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config/initializers/rack_attack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Rack::Attack
# Throttle all requests by IP (60rpm)
#
# Key: "rack::attack:#{Time.now.to_i/:period}:req/ip:#{req.ip}"
throttle('req/ip', limit: 300, period: 3.minutes) do |req|
throttle('req/ip', limit: 60, period: 60.seconds) do |req|
req.ip # unless req.path.start_with?('/assets')
end

Expand Down

0 comments on commit 94dddeb

Please sign in to comment.