Skip to content
Browse files

Add even more cookie tests, fixed InvalidMessage exception scope

  • Loading branch information...
1 parent 52a4346 commit ba7d38acee4ae0c02c92318a97c70208733f8464 @fxposter committed
View
2 actionpack/lib/action_dispatch/middleware/cookies.rb
@@ -395,7 +395,7 @@ def [](name)
@encryptor.decrypt_and_verify(encrypted_message)
end
rescue ActiveSupport::MessageVerifier::InvalidSignature,
- ActiveSupport::MessageVerifier::InvalidMessage
+ ActiveSupport::MessageEncryptor::InvalidMessage
nil
end
View
2 actionpack/test/dispatch/cookies_test.rb
@@ -382,6 +382,8 @@ def test_delete_and_set_signed_permanent_encrypted_cookie
assert_nil @controller.send(:cookies)[:user_name]
assert_nil @controller.send(:cookies).signed.permanent.encrypted[:user_name]
assert_equal @controller.send(:cookies).signed.permanent.encrypted[:user_surname], 'Smith'
+ assert_not_equal @controller.send(:cookies)[:user_surname], 'Smith'
+ assert_not_equal @controller.send(:cookies).encrypted[:user_surname], 'Smith'
end
def test_delete_and_set_cookie

0 comments on commit ba7d38a

Please sign in to comment.
Something went wrong with that request. Please try again.