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

XDomainRequest support #140

Merged
merged 14 commits into from
Nov 21, 2015
Merged

Conversation

vineethawal
Copy link

No description provided.

@vineethawal
Copy link
Author

Closes #131

@terrierscript
Copy link

+1

@vineethawal
Copy link
Author

@mzabriskie if the PR looks good can you have it merged?

@ldabiralai
Copy link

Good job! Any news on when this'll be merged?

Looking to use it in a project without having to reference the commit hash.

@vineethawal
Copy link
Author

@mzabriskie can we have this merged? we are waiting to use this feature in our project.

@mzabriskie
Copy link
Member

Sorry, I thought that I had replied to this already.

A couple changes need to be made, but overall I like the solution.

  • Don't commit the dist/ files
  • Resolve merge conflicts (probably just rebase on master)
  • Don't make XDomain a config option. This should be transparent to the user. Let's have axios handle the logic internally.
// This would go at the top of lib/adapters/xhr.js
var isURLSameOrigin = require('./../helpers/isURLSameOrigin');

// Slight modification to your code
var adapter = (XMLHttpRequest || ActiveXObject);
var loadEvent = 'onreadystatechange';
var xDomain = false;

// For IE 8/9 CORS support
if (!isURLSameOrigin(config.url) && window.XDomainRequest) {
  adapter = window.XDomainRequest;
  loadEvent = 'onload';
  xDomain = true;
}

@mzabriskie
Copy link
Member

There was a failing test on master when you merged. I have fixed the test. Please try merging master into your branch again.

@vineethawal
Copy link
Author

Done!

mzabriskie added a commit that referenced this pull request Nov 21, 2015
@mzabriskie mzabriskie merged commit 4bbde9a into axios:master Nov 21, 2015
@mzabriskie mzabriskie mentioned this pull request Dec 21, 2015
@axios axios locked and limited conversation to collaborators May 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants