Skip to content

feat: Use Fetch instead of XHR when available#1157

Merged
kamilogorek merged 2 commits intomasterfrom
fetch
Nov 30, 2017
Merged

feat: Use Fetch instead of XHR when available#1157
kamilogorek merged 2 commits intomasterfrom
fetch

Conversation

@kamilogorek
Copy link
Contributor

@kamilogorek kamilogorek commented Nov 30, 2017

Took best of both worlds from:

and added tests coverage.

@kamilogorek
Copy link
Contributor Author

kamilogorek commented Nov 30, 2017

Tests are broken in IE10/11 and mobile chrome. I'll fix them before merging.

var url = opts.url + '?' + urlencode(opts.auth);

if (supportsFetch()) {
return _window
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kamilogorek here is an issue - now, if you don't pass { credentials:"include" } (include or same-origin) fetch won't pass cookies. Not passing cookies breaks authorization for hosted servers that requires it :(

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants