From c5d4fce6e1de53c1411baad553e570eab0224a46 Mon Sep 17 00:00:00 2001 From: xiaohui <674321+xiaohui-zhangxh@users.noreply.github.com> Date: Fri, 20 Dec 2019 11:14:20 +0800 Subject: [PATCH] compact with rack 2.0.8+ --- app/controllers/impressionist_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/impressionist_controller.rb b/app/controllers/impressionist_controller.rb index 9bfcb22..21c8197 100644 --- a/app/controllers/impressionist_controller.rb +++ b/app/controllers/impressionist_controller.rb @@ -138,7 +138,10 @@ module ImpressionistController # str = request.session_options[:id] # logger.debug "Encoding: #{str.encoding.inspect}" # # request.session_options[:id].encode("ISO-8859-1") - request.session_options[:id] + id = request.session_options[:id] + # rack 2.0.8 releases new version of session id, id.to_s will raise error! + id = id.cookie_value if Rack::Session::SessionId.const_defined?(:ID_VERSION) && Rack::Session::SessionId::ID_VERSION == 2 + id end def params_hash