You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.stringifying a string does not make it safe for btoa.
Expected Behavior
Cookie properly set 😎
Actual Behavior
Cookie is not set and error is swallowed
The text was updated successfully, but these errors were encountered:
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 thatJSON.stringify
ing a string does not make it safe forbtoa
.Expected Behavior
Cookie properly set 😎
Actual Behavior
Cookie is not set and error is swallowed
The text was updated successfully, but these errors were encountered: