Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed an issue with migrating legacy json cookies. #14850

Merged
merged 1 commit into from Apr 23, 2014

Conversation

chancancode
Copy link
Member

Previously, the VerifyAndUpgradeLegacySignedMessage assumes all incoming
cookies are marshal-encoded. This is not the case when secret_token is
used in conjunction with the :json or :hybrid serializer.

In those case, when upgrading to use secret_key_base, this would cause a
TypeError: incompatible marshal file format and a 500 error for the user.

Fixes #14774.

Godfrey Chan

cc @rafaelfranca @guilleiguaran

馃槩 馃敨

@@ -1,3 +1,9 @@
* Fixed an issue with migrating legacy json cookies.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to include, actual error here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

馃憤

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

馃憤

Previously, the `VerifyAndUpgradeLegacySignedMessage` assumes all incoming
cookies are marshal-encoded. This is not the case when `secret_token` is
used in conjunction with the `:json` or `:hybrid` serializer.

In those case, when upgrading to use `secret_key_base`, this would cause a
`TypeError: incompatible marshal file format` and a 500 error for the user.

Fixes rails#14774.

*Godfrey Chan*
@chancancode
Copy link
Member Author

These tests could really use some refactoring later 馃槩

@rafaelfranca
Copy link
Member

:shipit:

guilleiguaran added a commit that referenced this pull request Apr 23, 2014
Fixed an issue with migrating legacy json cookies.
@guilleiguaran guilleiguaran merged commit e201140 into rails:master Apr 23, 2014
guilleiguaran added a commit that referenced this pull request May 23, 2014
Fixed an issue with migrating legacy json cookies.
Conflicts:
	actionpack/CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"TypeError: incompatible marshal file format (can't be read)" when loading cookies
4 participants