mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-03-25 09:25:49 +00:00
Override RedisCacheStoreProxy#read to always use raw: true
This commit is contained in:
parent
d5a240d9d2
commit
31dd7a8d17
1 changed files with 5 additions and 1 deletions
|
|
@ -15,7 +15,7 @@ module Rack
|
|||
#
|
||||
# So in order to workaround this we use RedisCacheStore#write (which sets expiration) to initialize
|
||||
# the counter. After that we continue using the original RedisCacheStore#increment.
|
||||
if options[:expires_in] && !read(name, raw: true)
|
||||
if options[:expires_in] && !read(name)
|
||||
write(name, amount, options)
|
||||
|
||||
amount
|
||||
|
|
@ -24,6 +24,10 @@ module Rack
|
|||
end
|
||||
end
|
||||
|
||||
def read(name, options = {})
|
||||
super(name, options.merge!(raw: true))
|
||||
end
|
||||
|
||||
def write(name, value, options = {})
|
||||
super(name, value, options.merge!(raw: true))
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue