mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-04-27 15:07:41 +00:00
Merge pull request #267 from grzuy/freeze_constants
Do not allow mutating constants
This commit is contained in:
commit
d7cc49117f
2 changed files with 3 additions and 2 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
module Rack
|
module Rack
|
||||||
class Attack
|
class Attack
|
||||||
module StoreProxy
|
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_WRAPPER_CLASSES = Set.new(['ActiveSupport::Cache::MemCacheStore', 'ActiveSupport::Cache::RedisStore']).freeze
|
||||||
ACTIVE_SUPPORT_CLIENTS = Set.new(['Redis::Store', 'Dalli::Client', 'MemCache']).freeze
|
ACTIVE_SUPPORT_CLIENTS = Set.new(['Redis::Store', 'Dalli::Client', 'MemCache']).freeze
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
module Rack
|
module Rack
|
||||||
class Attack
|
class Attack
|
||||||
class Throttle
|
class Throttle
|
||||||
MANDATORY_OPTIONS = [:limit, :period]
|
MANDATORY_OPTIONS = [:limit, :period].freeze
|
||||||
|
|
||||||
attr_reader :name, :limit, :period, :block, :type
|
attr_reader :name, :limit, :period, :block, :type
|
||||||
def initialize(name, options, block)
|
def initialize(name, options, block)
|
||||||
@name, @block = name, block
|
@name, @block = name, block
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue