From 41e68c09dce4fda5a48f8ee5fb2ebd7898733760 Mon Sep 17 00:00:00 2001 From: zaziemo Date: Mon, 19 Feb 2024 20:03:09 +0100 Subject: [PATCH] Reduce requests to 1 per second per IP [#1346] --- config/initializers/rack_attack.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/rack_attack.rb b/config/initializers/rack_attack.rb index 670424008..5dbb29aa2 100644 --- a/config/initializers/rack_attack.rb +++ b/config/initializers/rack_attack.rb @@ -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