Only set empty handlers for IE CORS support if using XDomainRequest #313
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I ran into a mysterious issue after upgrading Axios from 0.9.1 to 0.11.0 where a Selenium test was timing out only on Firefox, and was able to bisect the issue down to this commit. I'm assuming that this change was added based on the workaround for the issue reported here.
The problem seems to be that these handlers are being set on the request, even in test mode, which seems to have an unintended effect on promise resolution in Selenium, which I assume uses these handlers, but I haven't been able to find an exact path to track down the root cause.
This PR moves the workaround into the block that sets
request
to anXDomainRequest
, and fixes the issue. I'm assuming there isn't a reason that these should be set to empty handlers in any other case.