mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-04-27 15:07:41 +00:00
style: avoid compact class/module definitions
This commit is contained in:
parent
f5a352b8f9
commit
c8021da91c
3 changed files with 173 additions and 164 deletions
|
|
@ -41,6 +41,11 @@ Style/BlockDelimiters:
|
|||
Style/BracesAroundHashParameters:
|
||||
Enabled: true
|
||||
|
||||
Style/ClassAndModuleChildren:
|
||||
Enabled: true
|
||||
Exclude:
|
||||
- "spec/**/*"
|
||||
|
||||
Style/Encoding:
|
||||
Enabled: true
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@ require 'rack/attack/path_normalizer'
|
|||
require 'rack/attack/request'
|
||||
require "ipaddr"
|
||||
|
||||
class Rack::Attack
|
||||
module Rack
|
||||
class Attack
|
||||
class MisconfiguredStoreError < StandardError; end
|
||||
class MissingStoreError < StandardError; end
|
||||
|
||||
|
|
@ -161,4 +162,5 @@ class Rack::Attack
|
|||
|
||||
extend Forwardable
|
||||
def_delegators self, :safelisted?, :blocklisted?, :throttled?, :tracked?
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Rack::Attack
|
||||
module Rack
|
||||
class Attack
|
||||
# When using Rack::Attack with a Rails app, developers expect the request path
|
||||
# to be normalized. In particular, trailing slashes are stripped.
|
||||
# (See https://git.io/v0rrR for implementation.)
|
||||
|
|
@ -21,4 +22,5 @@ class Rack::Attack
|
|||
else
|
||||
FallbackPathNormalizer
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue