mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-03-25 09:25:49 +00:00
Merge pull request #344 from grzuy/clear_configuration
Avoid user confusion by renaming .clear! to .clear_configuration
This commit is contained in:
commit
e312f006b6
2 changed files with 7 additions and 2 deletions
|
|
@ -120,12 +120,17 @@ class Rack::Attack
|
|||
@cache ||= Cache.new
|
||||
end
|
||||
|
||||
def clear!
|
||||
def clear_configuration
|
||||
@safelists, @blocklists, @throttles, @tracks = {}, {}, {}, {}
|
||||
@ip_blocklists = []
|
||||
@ip_safelists = []
|
||||
end
|
||||
|
||||
def clear!
|
||||
warn "[DEPRECATION] Rack::Attack.clear! is deprecated. Please use Rack::Attack.clear_configuration instead"
|
||||
clear_configuration
|
||||
end
|
||||
|
||||
def blacklisted_response=(res)
|
||||
warn "[DEPRECATION] 'Rack::Attack.blacklisted_response=' is deprecated. Please use 'blocklisted_response=' instead."
|
||||
self.blocklisted_response = res
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ class MiniTest::Spec
|
|||
end
|
||||
|
||||
after do
|
||||
Rack::Attack.clear!
|
||||
Rack::Attack.clear_configuration
|
||||
Rack::Attack.instance_variable_set(:@cache, nil)
|
||||
|
||||
Rack::Attack.throttled_response = @_original_throttled_response
|
||||
|
|
|
|||
Loading…
Reference in a new issue