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

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

Closed
3 tasks done
fabiopaiva opened this issue Oct 18, 2018 · 3 comments
Closed
3 tasks done
Labels
🌐Networking Related to a networking API. Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@fabiopaiva
Copy link

fabiopaiva commented Oct 18, 2018

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);
@react-native-bot react-native-bot added 🌐Networking Related to a networking API. ⏪Old Version labels Oct 18, 2018
@react-native-bot
Copy link
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.

@fabiopaiva
Copy link
Author

axios/axios#1837

@react-native-bot
Copy link
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.

@react-native-bot react-native-bot added the Ran Commands One of our bots successfully processed a command. label Nov 2, 2018
@facebook facebook locked as resolved and limited conversation to collaborators Nov 2, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Nov 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🌐Networking Related to a networking API. Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

2 participants