Merge pull request #267 from grzuy/freeze_constants

Do not allow mutating constants
This commit is contained in:
Tieg Zaharia 2018-01-25 14:51:06 -05:00 committed by GitHub
commit d7cc49117f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -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

View file

@ -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