-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
Description
Which Remix packages are impacted?
-
remix
(Remix core) -
create-remix
-
@remix-run/architect
-
@remix-run/cloudflare-workers
-
@remix-run/dev
-
@remix-run/express
-
@remix-run/netlify
-
@remix-run/node
-
@remix-run/react
-
@remix-run/serve
-
@remix-run/server-runtime
-
@remix-run/vercel
What version of Remix are you using?
any
What version of Node are you using? Minimum supported version is 14.
14+
Steps to Reproduce
from sergiodxa/remix-auth#115 (@thangngoc89)
Try to encode a cookie with a UTF-16 string - ie "Nguyễn Văn A"
Essentially btoa
expects a string to be binary, so encountering characters that are UTF-16 encoded with more than 8 bits will throw an error. This is well-documented by Mozilla. In JSON and JavaScript, strings are UTF-16, so representing the characters is not an issue. However, this means that JSON.stringify
ing a string does not make it safe for btoa
.
Expected Behavior
Cookie properly set 😎
Actual Behavior
Cookie is not set and error is swallowed
nimaa77, sergiodxa, thangngoc89, tageecc and adrm