Skip to content

Fix XMLHttpRequest prototype-key headers - #58233

Open
OskarEichler wants to merge 1 commit into
react:mainfrom
OskarEichler:codex/fix-xhr-prototype-key-headers
Open

Fix XMLHttpRequest prototype-key headers#58233
OskarEichler wants to merge 1 commit into
react:mainfrom
OskarEichler:codex/fix-xhr-prototype-key-headers

Conversation

@OskarEichler

Copy link
Copy Markdown
Contributor

Summary:

React Native XMLHttpRequest stores request and normalized response headers in ordinary objects, so valid names such as constructor, __proto__, and toString collide with inherited properties. Use prototype-free header maps on reset and response normalization, simplify normalization to a direct loop, and cover request combination plus response lookup behavior.

Fixes #58232.

Changelog:

[GENERAL] [FIXED] - Support XMLHttpRequest header names that overlap Object prototype properties.

Test Plan:

  • Exact upstream suite: 14 existing tests passed and both new regressions failed.
  • Fixed focused Jest suite: 16/16 passed.
  • Fresh Flow check: 0 errors.
  • Targeted no-ignore ESLint, Prettier, and git diff --check passed.

No UI change; screenshots are not applicable.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 30, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

XMLHttpRequest corrupts headers named after Object prototype properties

1 participant