Skip to content

fix: handle lone surrogates in route continue post data - #3378

Draft
himanshug189-sketch wants to merge 1 commit into
microsoft:mainfrom
himanshug189-sketch:fix-route-continue-lone-surrogate
Draft

himanshug189-sketch wants to merge 1 commit into
microsoft:mainfrom
himanshug189-sketch:fix-route-continue-lone-surrogate

Conversation

@himanshug189-sketch

Copy link
Copy Markdown

Summary

Fixes an issue where route.continue_() raises a UnicodeEncodeError when post_data contains lone surrogate characters.

Changes

  • Handle lone high and low surrogate characters during JSON serialization.
  • Preserve valid UTF-16 surrogate pairs correctly.
  • Maintain correct serialization of regular Unicode characters and emoji.
  • Add a regression test covering lone surrogates, valid surrogate pairs, Unicode characters, and emoji in request payloads.

Validation

  • Verified the regression test on Chromium, Firefox, and WebKit.
  • Full test_page_route.py suite: 174 passed, 5 skipped, 1 xfailed.

Fixes #3374

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

This branch has not been deployed

No deployments
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.

[Bug]: route.continue_() fails to encode post_data containing lone surrogate characters

2 participants