Skip to content

Commit

Permalink
fix safelist
Browse files Browse the repository at this point in the history
  • Loading branch information
stkenny committed Feb 14, 2025
1 parent 69182ed commit dd558e7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions config/initializers/rack_attack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# quickly. If so, enable the condition to exclude them from tracking.

Rack::Attack.safelist_ip(ENV["RACK_ATTACK_SAFELIST"])
Rack::Attack.safelist_ip(ENV["10.115.0.0/24"])
Rack::Attack.safelist_ip("10.115.0.0/24")

# Throttle all requests by IP
#
Expand All @@ -34,7 +34,9 @@
# averaging over a minute -- after bot attacks costing us money from s3.
Rack::Attack.throttle('req/ip', limit: 80, period: 1.minutes) do |req|
req.ip unless (
req.path.start_with?('/assets')
req.path.start_with?('/assets') ||
req.path.start_with?("/images") ||
req.path.start_with?("/iiif")
)
end

Expand Down

0 comments on commit dd558e7

Please sign in to comment.