Skip to content

Default value from property withCredentials in XMLHttpRequest should be false #21852

@fabio-paiva-sp

Description

@fabio-paiva-sp

Environment

System:
OS: macOS High Sierra 10.13.6
CPU: x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
Memory: 2.07 GB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 8.12.0 - ~/.nvm/versions/node/v8.12.0/bin/node
Yarn: 1.10.1 - ~/.nvm/versions/node/v8.12.0/bin/yarn
npm: 6.4.1 - ~/.nvm/versions/node/v8.12.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 11.4, macOS 10.13, tvOS 11.4, watchOS 4.3
IDEs:
Android Studio: 3.2 AI-181.5540.7.32.5056338
Xcode: 9.4.1/9F2000 - /usr/bin/xcodebuild
npmPackages:
react: 16.6.0-alpha.8af6728 => 16.6.0-alpha.8af6728
react-native: 0.57.3 => 0.57.3
npmGlobalPackages:
react-native-cli: 2.0.1

Description

The default value from property withCredentials in XMLHttpRequest.js is true.
In Google Chrome Javascript engine it's false, in the most commons node JS libraries it's false or undefined. Why it's true in React Native?

I can't change it to false using Axios because the library is not checking the property correctly to set it to false. They assume the default is false.

// Axios library
// Add withCredentials to request if needed
    if (config.withCredentials) {
      request.withCredentials = true;
    }

It will never set it to false.

Reproducible Demo

axios({
  url: 'https://www.httpbin.org/anything',
  withCredentials: false,
}).then(console.log).catch(console.error);

Activity

react-native-bot

react-native-bot commented on Oct 18, 2018

@react-native-bot
Collaborator

It looks like you are using an older version of React Native. Please update to the latest release, v0.57 and verify if the issue still exists.

The ":rewind:Old Version" label will be removed automatically once you edit your original post with the results of running react-native info on a project using the latest release.

fabio-paiva-sp

fabio-paiva-sp commented on Oct 18, 2018

@fabio-paiva-sp
Author
react-native-bot

react-native-bot commented on Nov 2, 2018

@react-native-bot
Collaborator

I am closing this issue because it does not appear to have been verified on the latest release, and there has been no followup in a while.

If you found this thread after encountering the same issue in the latest release, please feel free to create a new issue with up-to-date information by clicking here.

locked as resolved and limited conversation to collaborators on Nov 2, 2019
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

    Ran CommandsOne of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.🌐NetworkingRelated to a networking API.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @fabio-paiva-sp@react-native-bot

        Issue actions

          Default value from property `withCredentials` in XMLHttpRequest should be false · Issue #21852 · facebook/react-native