mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-03-25 09:25:49 +00:00
In v4.4.0, checking `defined?(ActiveSupport::Cache::MemCacheStore)`
could trigger an error loading dalli, which isn’t needed.
This fixes that bug, and prevents similar bugs by checking
`store.class.to_s` rather than `defined?(klass) && store.is_a?(klass)`.
Writing an automated test to ensure that dalli is truly optional is
difficult, but I was able to recreate the dalli load error in v4.4.0 by
running:
gem uninstall dalli
ruby -Ilib -ractive_support/all -ractive_support/cache/redis_store
-rrack/attack -e 'p Rack::Attack::StoreProxy.build(Redis::Store.new)'
Fixes #163
|
||
|---|---|---|
| .. | ||
| store_proxy | ||
| allow2ban.rb | ||
| blacklist.rb | ||
| cache.rb | ||
| check.rb | ||
| fail2ban.rb | ||
| path_normalizer.rb | ||
| request.rb | ||
| store_proxy.rb | ||
| throttle.rb | ||
| track.rb | ||
| version.rb | ||
| whitelist.rb | ||