Skip to content

Commit

Permalink
Merge pull request #1402 from rubymonsters/1361-block-topics-route
Browse files Browse the repository at this point in the history
Add topics path to rack attack
  • Loading branch information
zaziemo authored Jul 30, 2024
2 parents 8232893 + 7f72aed commit 438a936
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions config/initializers/rack_attack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 438a936

Please sign in to comment.