Skip to content

Commit

Permalink
Fix Rails 4 suite
Browse files Browse the repository at this point in the history
  • Loading branch information
santib committed Oct 16, 2023
1 parent ceabba1 commit 455ddcf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rack/attack/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ def blocklist(name = nil, &block)
end

def blocklist_ip(ip_address)
@anonymous_blocklists << Blocklist.new { |request| IPAddr.new(ip_address).include?(IPAddr.new(*request.ip)) }
@anonymous_blocklists << Blocklist.new { |request| !request.ip&.empty? && IPAddr.new(ip_address).include?(IPAddr.new(request.ip)) }
end

def safelist_ip(ip_address)
@anonymous_safelists << Safelist.new { |request| IPAddr.new(ip_address).include?(IPAddr.new(*request.ip)) }
@anonymous_safelists << Safelist.new { |request| !request.ip&.empty? && IPAddr.new(ip_address).include?(IPAddr.new(request.ip)) }
end

def throttle(name, options, &block)
Expand Down

0 comments on commit 455ddcf

Please sign in to comment.