mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-03-25 09:25:49 +00:00
Enable rubocop Naming cops
This commit is contained in:
parent
972a19006a
commit
e6854bcb02
2 changed files with 9 additions and 4 deletions
|
|
@ -16,6 +16,11 @@ Layout:
|
|||
Lint:
|
||||
Enabled: true
|
||||
|
||||
Naming:
|
||||
Enabled: true
|
||||
Exclude:
|
||||
- "lib/rack/attack/path_normalizer.rb"
|
||||
|
||||
Performance:
|
||||
Enabled: true
|
||||
|
||||
|
|
|
|||
|
|
@ -38,15 +38,15 @@ class Rack::Attack
|
|||
self.blocklists[name] = Blocklist.new(name, block)
|
||||
end
|
||||
|
||||
def blocklist_ip(ip)
|
||||
def blocklist_ip(ip_address)
|
||||
@ip_blocklists ||= []
|
||||
ip_blocklist_proc = lambda { |request| IPAddr.new(ip).include?(IPAddr.new(request.ip)) }
|
||||
ip_blocklist_proc = lambda { |request| IPAddr.new(ip_address).include?(IPAddr.new(request.ip)) }
|
||||
@ip_blocklists << Blocklist.new(nil, ip_blocklist_proc)
|
||||
end
|
||||
|
||||
def safelist_ip(ip)
|
||||
def safelist_ip(ip_address)
|
||||
@ip_safelists ||= []
|
||||
ip_safelist_proc = lambda { |request| IPAddr.new(ip).include?(IPAddr.new(request.ip)) }
|
||||
ip_safelist_proc = lambda { |request| IPAddr.new(ip_address).include?(IPAddr.new(request.ip)) }
|
||||
@ip_safelists << Safelist.new(nil, ip_safelist_proc)
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue