mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-03-25 09:25:49 +00:00
Do not allow mutating constants
This commit is contained in:
parent
6f545e2665
commit
7286517c2f
2 changed files with 3 additions and 2 deletions
|
|
@ -1,7 +1,7 @@
|
|||
module Rack
|
||||
class Attack
|
||||
module StoreProxy
|
||||
PROXIES = [DalliProxy, MemCacheProxy, RedisStoreProxy]
|
||||
PROXIES = [DalliProxy, MemCacheProxy, RedisStoreProxy].freeze
|
||||
|
||||
ACTIVE_SUPPORT_WRAPPER_CLASSES = Set.new(['ActiveSupport::Cache::MemCacheStore', 'ActiveSupport::Cache::RedisStore']).freeze
|
||||
ACTIVE_SUPPORT_CLIENTS = Set.new(['Redis::Store', 'Dalli::Client', 'MemCache']).freeze
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
module Rack
|
||||
class Attack
|
||||
class Throttle
|
||||
MANDATORY_OPTIONS = [:limit, :period]
|
||||
MANDATORY_OPTIONS = [:limit, :period].freeze
|
||||
|
||||
attr_reader :name, :limit, :period, :block, :type
|
||||
def initialize(name, options, block)
|
||||
@name, @block = name, block
|
||||
|
|
|
|||
Loading…
Reference in a new issue