From c17649e062c95c841afe8efbc1962cc0e2df886e Mon Sep 17 00:00:00 2001 From: Kasper Timm Hansen Date: Sun, 6 Sep 2015 17:56:53 +0200 Subject: 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. --- actionpack/lib/action_dispatch/middleware/cookies.rb | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_dispatch/middleware/cookies.rb b/actionpack/lib/action_dispatch/middleware/cookies.rb index b27236d5fa..0f3de18aa0 100644 --- a/actionpack/lib/action_dispatch/middleware/cookies.rb +++ b/actionpack/lib/action_dispatch/middleware/cookies.rb @@ -510,7 +510,7 @@ module ActionDispatch 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 @@ module ActionDispatch 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 @@ module ActionDispatch 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 -- cgit v1.2.3