提交 e05136ab 编写于 作者: K Kasper Timm Hansen

Pull up parse to the legacy upgrading module

It was the same in both legacy versions of the signed and encrypted cookie jars.
上级 c9efdb58
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册