Skip to content

XMLHttpRequest corrupts headers named after Object prototype properties #58232

Description

@OskarEichler

Description

React Native XMLHttpRequest stores request headers and normalized response headers in ordinary objects. Valid header names that collide with Object.prototype are therefore corrupted or hidden: repeated Constructor values begin with inherited function text, __proto__ cannot be stored normally, and an absent toString response header is returned as an inherited function instead of null.

Expected behavior

All valid case-insensitive header names should be stored, combined, and retrieved as their own values without interacting with JavaScript object prototypes.

React Native Version

0.87.1 and current main

Affected Platforms

JavaScript networking - All

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Author FeedbackNeeds: ReproThis issue could be improved with a clear list of steps to reproduce the issue.StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions