mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-04-27 15:07:41 +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:
|
Style/HashSyntax:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
Style/MultilineTernaryOperator:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Style/NestedTernaryOperator:
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Style/OptionalArguments:
|
Style/OptionalArguments:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -110,12 +110,18 @@ module Rack
|
||||||
@app.call(env)
|
@app.call(env)
|
||||||
elsif configuration.blocklisted?(request)
|
elsif configuration.blocklisted?(request)
|
||||||
# Deprecated: Keeping blocklisted_response for backwards compatibility
|
# Deprecated: Keeping blocklisted_response for backwards compatibility
|
||||||
configuration.blocklisted_response ? configuration.blocklisted_response.call(env) :
|
if configuration.blocklisted_response
|
||||||
configuration.blocklisted_callback.call(request)
|
configuration.blocklisted_response.call(env)
|
||||||
|
else
|
||||||
|
configuration.blocklisted_callback.call(request)
|
||||||
|
end
|
||||||
elsif configuration.throttled?(request)
|
elsif configuration.throttled?(request)
|
||||||
# Deprecated: Keeping throttled_response for backwards compatibility
|
# Deprecated: Keeping throttled_response for backwards compatibility
|
||||||
configuration.throttled_response ? configuration.throttled_response.call(env) :
|
if configuration.throttled_response
|
||||||
configuration.throttled_callback.call(request)
|
configuration.throttled_response.call(env)
|
||||||
|
else
|
||||||
|
configuration.throttled_callback.call(request)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
configuration.tracked?(request)
|
configuration.tracked?(request)
|
||||||
@app.call(env)
|
@app.call(env)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue