mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-04-27 15:07:41 +00:00
Enable Style/BracesAroundHashParameters rubocop cop
This commit is contained in:
parent
1e9d601483
commit
86eb9f9e0a
3 changed files with 6 additions and 3 deletions
|
|
@ -30,6 +30,9 @@ Security:
|
||||||
Lint:
|
Lint:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
Style/BracesAroundHashParameters:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Style/FrozenStringLiteralComment:
|
Style/FrozenStringLiteralComment:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,11 +18,11 @@ module Rack
|
||||||
end
|
end
|
||||||
|
|
||||||
def read(name, options = {})
|
def read(name, options = {})
|
||||||
super(name, options.merge!({ raw: true }))
|
super(name, options.merge!(raw: true))
|
||||||
end
|
end
|
||||||
|
|
||||||
def write(name, value, options = {})
|
def write(name, value, options = {})
|
||||||
super(name, value, options.merge!({ raw: true }))
|
super(name, value, options.merge!(raw: true))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ describe 'Rack::Attack.throttle' do
|
||||||
it 'should tag the env' do
|
it 'should tag the env' do
|
||||||
last_request.env['rack.attack.matched'].must_equal 'ip/sec'
|
last_request.env['rack.attack.matched'].must_equal 'ip/sec'
|
||||||
last_request.env['rack.attack.match_type'].must_equal :throttle
|
last_request.env['rack.attack.match_type'].must_equal :throttle
|
||||||
last_request.env['rack.attack.match_data'].must_equal({ :count => 2, :limit => 1, :period => @period })
|
last_request.env['rack.attack.match_data'].must_equal(:count => 2, :limit => 1, :period => @period)
|
||||||
last_request.env['rack.attack.match_discriminator'].must_equal('1.2.3.4')
|
last_request.env['rack.attack.match_discriminator'].must_equal('1.2.3.4')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue