aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2015-09-06 17:56:53 +0200
committerKasper Timm Hansen <kaspth@gmail.com>2015-09-08 20:27:05 +0200
commitc17649e062c95c841afe8efbc1962cc0e2df886e (patch)
tree13245dae5fa50ec1114a59b7f13e6d9edd478450 /actionpack
parent39882c49dcb099d764788b00c64e629003235d63 (diff)
downloadrails-c17649e062c95c841afe8efbc1962cc0e2df886e.tar.gz
rails-c17649e062c95c841afe8efbc1962cc0e2df886e.tar.bz2
rails-c17649e062c95c841afe8efbc1962cc0e2df886e.zip
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.
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/middleware/cookies.rb10
1 files changed, 2 insertions, 8 deletions
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