Split the theme_key so we extract the key from seq

This commit is contained in:
Sam 2017-06-15 14:09:33 -04:00
parent eb9f306e64
commit bdb848b4f3
1 changed files with 3 additions and 2 deletions

View File

@ -1,5 +1,6 @@
require_dependency "mobile_detection" require_dependency "mobile_detection"
require_dependency "crawler_detection" require_dependency "crawler_detection"
require_dependency "guardian"
module Middleware module Middleware
class AnonymousCache class AnonymousCache
@ -15,7 +16,7 @@ module Middleware
def initialize(env) def initialize(env)
@env = env @env = env
@request = Rack::Request.new(env) @request = Rack::Request.new(@env)
end end
def is_mobile=(val) def is_mobile=(val)
@ -59,7 +60,7 @@ module Middleware
end end
def theme_key def theme_key
key = @request.cookies['theme_key'] key,_ = @request.cookies['theme_key']&.split(',')
if key && Guardian.new.allow_theme?(key) if key && Guardian.new.allow_theme?(key)
key key
else else