aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/middleware/cookies.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/cookies.rb b/actionpack/lib/action_dispatch/middleware/cookies.rb
index 7e8a395d93..fa94f9c9e4 100644
--- a/actionpack/lib/action_dispatch/middleware/cookies.rb
+++ b/actionpack/lib/action_dispatch/middleware/cookies.rb
@@ -384,6 +384,18 @@ module ActionDispatch
end
end
+ class HybridSerializer < JsonSerializer
+ MARSHAL_SIGNATURE = "\x04\x08".freeze
+
+ def self.load(value)
+ if value.start_with?(MARSHAL_SIGNATURE)
+ Marshal.load(value)
+ else
+ super
+ end
+ end
+ end
+
module SerializedCookieJars
protected
def serializer
@@ -393,6 +405,8 @@ module ActionDispatch
Marshal
when :json
JsonSerializer
+ when :hybrid
+ HybridSerializer
else
serializer
end