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

In browsers check for XMLHttpRequest, not window #85

Merged
merged 2 commits into from
Jul 23, 2015

Conversation

tomaash
Copy link
Contributor

@tomaash tomaash commented Jul 13, 2015

In nodejs testing environment it's possible to use https://github.com/tmpvar/jsdom library to define a window object, but you still want to use node http adapter. Due to those diverse testing environmnents, I propose to test for XMLHttpRequest directly, because window global object is not a sure sign of a browser environment anymore.

In nodejs testing environment it's possible to use https://github.com/tmpvar/jsdom library to define a window object, but you still want to use node http adapter. Due to those diverse testing environmnents, I propose to test for XMLHttpRequest directly, because window global object is not a sure sign of a browser environment anymore.
@mzabriskie
Copy link
Member

Thanks for the PR. Unfortunately XMLHttpRequest doesn't exist in older versions of IE. Can you provide a solution that works for IE8?

Test for ActiveXObject
@tomaash
Copy link
Contributor Author

tomaash commented Jul 23, 2015

Damn, I always forget about those IE specialities. I added check for ActiveXObject, so now it should work in IE8 as well.

@mzabriskie
Copy link
Member

Looks good. Thank you!

@mzabriskie mzabriskie closed this Jul 23, 2015
@mzabriskie mzabriskie reopened this Jul 23, 2015
mzabriskie added a commit that referenced this pull request Jul 23, 2015
In browsers check for XMLHttpRequest, not window
@mzabriskie mzabriskie merged commit 63ac064 into axios:master Jul 23, 2015
@tomaash
Copy link
Contributor Author

tomaash commented Jul 23, 2015

Thanks for merging this. Can you please also bump patch version?

@mzabriskie
Copy link
Member

I'm working on getting a new release out soon.

@mzabriskie
Copy link
Member

@tomaash I just released 0.6.0 which includes your PR.

@tomaash
Copy link
Contributor Author

tomaash commented Sep 22, 2015

Cool, thanks!

On Tue, Sep 22, 2015 at 12:58 AM, Matt Zabriskie notifications@github.com
wrote:

@tomaash https://github.com/tomaash I just released 0.6.0 which
includes your PR.


Reply to this email directly or view it on GitHub
#85 (comment).

@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

2 participants