mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-03-25 09:25:49 +00:00
refactor: remove unnecessary block local variable
This commit is contained in:
parent
5a42fd3ac7
commit
3639afc196
1 changed files with 2 additions and 4 deletions
|
|
@ -50,13 +50,11 @@ class Rack::Attack
|
|||
end
|
||||
|
||||
def blocklist_ip(ip_address)
|
||||
ip_blocklist_proc = lambda { |request| IPAddr.new(ip_address).include?(IPAddr.new(request.ip)) }
|
||||
anonymous_blocklists << Blocklist.new(nil, &ip_blocklist_proc)
|
||||
anonymous_blocklists << Blocklist.new(nil) { |request| IPAddr.new(ip_address).include?(IPAddr.new(request.ip)) }
|
||||
end
|
||||
|
||||
def safelist_ip(ip_address)
|
||||
ip_safelist_proc = lambda { |request| IPAddr.new(ip_address).include?(IPAddr.new(request.ip)) }
|
||||
anonymous_safelists << Safelist.new(nil, &ip_safelist_proc)
|
||||
anonymous_safelists << Safelist.new(nil) { |request| IPAddr.new(ip_address).include?(IPAddr.new(request.ip)) }
|
||||
end
|
||||
|
||||
def throttle(name, options, &block)
|
||||
|
|
|
|||
Loading…
Reference in a new issue