mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-03-25 09:25:49 +00:00
style: avoid multiline ternary operator
This commit is contained in:
parent
8ededbc738
commit
53c1d93fd1
2 changed files with 16 additions and 4 deletions
|
|
@ -68,6 +68,12 @@ Style/FrozenStringLiteralComment:
|
|||
Style/HashSyntax:
|
||||
Enabled: true
|
||||
|
||||
Style/MultilineTernaryOperator:
|
||||
Enabled: true
|
||||
|
||||
Style/NestedTernaryOperator:
|
||||
Enabled: true
|
||||
|
||||
Style/OptionalArguments:
|
||||
Enabled: true
|
||||
|
||||
|
|
|
|||
|
|
@ -110,12 +110,18 @@ module Rack
|
|||
@app.call(env)
|
||||
elsif configuration.blocklisted?(request)
|
||||
# Deprecated: Keeping blocklisted_response for backwards compatibility
|
||||
configuration.blocklisted_response ? configuration.blocklisted_response.call(env) :
|
||||
configuration.blocklisted_callback.call(request)
|
||||
if configuration.blocklisted_response
|
||||
configuration.blocklisted_response.call(env)
|
||||
else
|
||||
configuration.blocklisted_callback.call(request)
|
||||
end
|
||||
elsif configuration.throttled?(request)
|
||||
# Deprecated: Keeping throttled_response for backwards compatibility
|
||||
configuration.throttled_response ? configuration.throttled_response.call(env) :
|
||||
configuration.throttled_callback.call(request)
|
||||
if configuration.throttled_response
|
||||
configuration.throttled_response.call(env)
|
||||
else
|
||||
configuration.throttled_callback.call(request)
|
||||
end
|
||||
else
|
||||
configuration.tracked?(request)
|
||||
@app.call(env)
|
||||
|
|
|
|||
Loading…
Reference in a new issue