From e05136ab41916a91add7d46f26cf119ff0dfaf34 Mon Sep 17 00:00:00 2001 From: Kasper Timm Hansen Date: Sun, 6 Sep 2015 18:01:53 +0200 Subject: [PATCH] Pull up parse to the legacy upgrading module It was the same in both legacy versions of the signed and encrypted cookie jars. --- .../lib/action_dispatch/middleware/cookies.rb | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/actionpack/lib/action_dispatch/middleware/cookies.rb b/actionpack/lib/action_dispatch/middleware/cookies.rb index 12c19d0098..b292efee5c 100644 --- a/actionpack/lib/action_dispatch/middleware/cookies.rb +++ b/actionpack/lib/action_dispatch/middleware/cookies.rb @@ -253,6 +253,11 @@ def verify_and_upgrade_legacy_signed_message(name, signed_message) rescue ActiveSupport::MessageVerifier::InvalidSignature nil end + + private + def parse(name, signed_message) + super || verify_and_upgrade_legacy_signed_message(name, signed_message) + end end class CookieJar #:nodoc: @@ -526,11 +531,6 @@ def commit(options) # re-saves them using the new key generator to provide a smooth upgrade path. class UpgradeLegacySignedCookieJar < SignedCookieJar #:nodoc: include VerifyAndUpgradeLegacySignedMessage - - private - def parse(name, signed_message) - super || verify_and_upgrade_legacy_signed_message(name, signed_message) - end end class EncryptedCookieJar < AbstractCookieJar # :nodoc: @@ -569,11 +569,6 @@ def commit(options) # encrypts and re-saves them using the new key generator to provide a smooth upgrade path. class UpgradeLegacyEncryptedCookieJar < EncryptedCookieJar #:nodoc: include VerifyAndUpgradeLegacySignedMessage - - private - def parse(name, encrypted_or_signed_message) - super || verify_and_upgrade_legacy_signed_message(name, encrypted_or_signed_message) - end end def initialize(app) -- GitLab