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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(remix-server-runtime): fix invalid character error in cookie serialize #2257

Merged
merged 3 commits into from
Mar 31, 2022

Conversation

aiji42
Copy link
Contributor

@aiji42 aiji42 commented Mar 8, 2022

Fixed a bug that caused an error when cookie serializing data containing non-ascii characters.

  • Tests

Closes #1282
Closes #2255

@mkrtchian
Copy link
Contributor

A similar PR exists as #1290, related to issue #1282

@aiji42 aiji42 force-pushed the fix-invalid-character-error branch from 465ef9b to 09be2dd Compare March 9, 2022 02:46
@remix-cla-bot
Copy link
Contributor

remix-cla-bot bot commented Mar 9, 2022

Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳

@aiji42
Copy link
Contributor Author

aiji42 commented Mar 9, 2022

@mkrtchian Thanks for letting me know. I did not know that.
This PR takes a different approach (smaller size of the encoded result) than that one. I will leave it to the development team and community to decide which one to adopt.

#1290 (comment)

@mjackson
Copy link
Member

One thing we need to be careful about: I'm not sure if all the JS runtimes we support will have escape and unescape because they are currently in Annex B of ECMA-262 which states that we "should not use or assume the existence of these features and behaviors when writing new ECMAScript code".

The main other runtimes I'm concerned about at this point are Cloudflare and Deno, both of which we have support for. Polyfilling the environment is totally something we can do, I just want to make sure we have test coverage for both before merging something like this.

@aiji42
Copy link
Contributor Author

aiji42 commented Mar 22, 2022

@mjackson Thanks for the follow up.

Polyfilling the environment is totally something we can do, I just want to make sure we have test coverage for both before merging something like this.

Does this mean specifically that I should use the alternative code (see core-js) instead of using escape and unescape? Or are you asking me to create samples that runs on both Deno and Cloudflare, test it, and present it?
If you give me specific instructions, I will start working immediately.

@aiji42 aiji42 force-pushed the fix-invalid-character-error branch from d16d501 to 09be2dd Compare March 23, 2022 13:10
@aiji42
Copy link
Contributor Author

aiji42 commented Mar 23, 2022

I haven't received a reply yet, but I polyfilled escape and unescape with reference to the core-js code. If the policy is different, please tell me. Withdraw the last commit.

@machour machour requested a review from mjackson March 23, 2022 14:05
@MichaelDeBoey MichaelDeBoey changed the title fix: invalid character error in cookie serialize fix(remix-server-runtime): fix invalid character error in cookie serialize Mar 28, 2022
@MichaelDeBoey MichaelDeBoey force-pushed the fix-invalid-character-error branch from d81a150 to b26748a Compare March 28, 2022 15:04
@jacob-ebey jacob-ebey merged commit 921065b into remix-run:dev Mar 31, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Apr 6, 2022

🤖 Hello there,

We just published version v1.3.5-pre.1 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

aaronpowell pushed a commit to aaronpowell/remix that referenced this pull request May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants