From 7f72aede4b2d7d311bc33240e8e25789d1b9743a Mon Sep 17 00:00:00 2001 From: zaziemo Date: Mon, 29 Jul 2024 20:58:53 +0200 Subject: [PATCH] Add topics path to rack attack [#1361] --- config/initializers/rack_attack.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/initializers/rack_attack.rb b/config/initializers/rack_attack.rb index 3c0253f3f..306038958 100644 --- a/config/initializers/rack_attack.rb +++ b/config/initializers/rack_attack.rb @@ -62,6 +62,12 @@ class Rack::Attack end end + blocklist('block all access to deprecated paths') do |request| + # Requests are blocked if the return value is truthy + request.path.start_with?("/de/topics") + request.path.start_with?("/en/topics") + end + ### Custom Throttle Response ### # By default, Rack::Attack returns an HTTP 429 for throttled responses,