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

Call super to remove the verify method

`SignedCookieJar`'s parse method already attempts to verify the message,
so we can just call super and try the old verifier if it fails.
上级 39882c49
......@@ -510,7 +510,7 @@ def initialize(parent_jar)
private
def parse(name, signed_message)
deserialize name, verify(signed_message)
deserialize name, @verifier.verified(signed_message)
end
def commit(options)
......@@ -518,12 +518,6 @@ def commit(options)
raise CookieOverflow if options[:value].bytesize > MAX_COOKIE_SIZE
end
def verify(signed_message)
@verifier.verify(signed_message)
rescue ActiveSupport::MessageVerifier::InvalidSignature
nil
end
end
# UpgradeLegacySignedCookieJar is used instead of SignedCookieJar if
......@@ -535,7 +529,7 @@ class UpgradeLegacySignedCookieJar < SignedCookieJar #:nodoc:
private
def parse(name, signed_message)
deserialize(name, verify(signed_message)) || verify_and_upgrade_legacy_signed_message(name, signed_message)
super || verify_and_upgrade_legacy_signed_message(name, signed_message)
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册