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: Broken escaped unicode crashes JSON parser #452

Merged
merged 1 commit into from
Mar 19, 2024

Conversation

route
Copy link
Member

@route route commented Mar 19, 2024

Assigning broken unicode to a node directly from JS can lead to JSON::ParserError: incomplete surrogate pair at ... error. We try to unescape unicode code points and replace invalid ones with ? char now. If still after that JSON cannot parse the string, we raise error. That's anyways the best we can do, we can't just skip CDP message.

Assigning broken unicode to a node directly from JS can lead to `JSON::ParserError: incomplete surrogate pair at ...` error. We try to unescape unicode code points and replace invalid ones with `?` char now. If still after that JSON cannot parse the string, we raise error. That's anyways the best we can do, we can't just skip CDP message.
@route route merged commit 842d2ea into main Mar 19, 2024
7 checks passed
@route route deleted the fix-invalid-unicode-message branch March 19, 2024 08:15
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.

1 participant