mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-04-01 10:35:52 +00:00
[Fixes #355] Avoid unexpected 'Gem::LoadError' for redis when not intented to be used
It seems that the original implementation accidentally autoloaded ActiveSupport::Cache::RedisCacheStore which once evaluated asks for redis v4 generating Gem::LoadError. In order to bypass any unnecessary constant autoloading we can just check class name string.
This commit is contained in:
parent
82c0a17dd4
commit
935f99a638
1 changed files with 1 additions and 1 deletions
|
|
@ -7,7 +7,7 @@ module Rack
|
|||
module StoreProxy
|
||||
class RedisCacheStoreProxy < SimpleDelegator
|
||||
def self.handle?(store)
|
||||
defined?(::Redis) && defined?(::ActiveSupport::Cache::RedisCacheStore) && store.is_a?(::ActiveSupport::Cache::RedisCacheStore)
|
||||
store.class.name == "ActiveSupport::Cache::RedisCacheStore"
|
||||
end
|
||||
|
||||
def increment(name, amount = 1, options = {})
|
||||
|
|
|
|||
Loading…
Reference in a new issue