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

[General] fixes fetch module credentials #24726

Closed
wants to merge 1 commit into from

Conversation

zhongwuzw
Copy link
Contributor

Summary

In #14063, we decided to set withCredential to true by default, now if we use XMLHttpRequest, it works, but for fetch polyfill, withCredential is be set to false because we use Request's credentials https://github.com/facebook/react-native/blob/master/Libraries/vendor/core/whatwg-fetch.js#L515.

So we have inconsistency about withCrendential. My fix is to change Request credentials default value to same-origin, it reasonable because refer to MDN, the default value is same-origin.

cc. @cpojer.

Changelog

[General] [Fixed] - fixes fetch module credentials

Test Plan

For any request from either XMLHttpRequest or fetch, we set withCredential to true by default.

@facebook-github-bot facebook-github-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 May 7, 2019
@react-native-bot react-native-bot added 🌐Networking Related to a networking API. Bug labels May 7, 2019
@zhigang1992
Copy link
Contributor

Seems like this file is getting revert back to the npm version. #24418

@cpojer
Copy link
Contributor

cpojer commented May 7, 2019

I don't think we can change this as we are getting rid of the fetch fork. Maybe we can change something in fetch to do the right thing by default for RN?

@cpojer cpojer closed this May 7, 2019
@zhongwuzw
Copy link
Contributor Author

@cpojer Please see #24418 (comment) or #14063. We changed some behavior because react-native is not for web.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. 🌐Networking Related to a networking API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants