Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

$http empty response body for IE9 #6558

Closed
bvaughn opened this issue Mar 5, 2014 · 6 comments
Closed

$http empty response body for IE9 #6558

bvaughn opened this issue Mar 5, 2014 · 6 comments

Comments

@bvaughn
Copy link

bvaughn commented Mar 5, 2014

This issue is occurring for Angular 1.2.10 and seems to still exist in Git. It is related to #4738 and #4464. Supposedly the above defects were fixed with commit 509ec74 but the fix isn't working as expected in IE9.

The IE debugger shows that the XHR object defines a response attribute but it is null. The response body is contained within a responseText attribute.

So perhaps a better fix for this would be to change httpBackend line 94 from this:

response = ('response' in xhr) ? xhr.response : xhr.responseText;

To something more like this:

response = ('responseText' in xhr) ? xhr.responseText : xhr.response;
@davidjnelson davidjnelson self-assigned this Mar 5, 2014
@davidjnelson davidjnelson added this to the 1.3.x milestone Mar 5, 2014
@davidjnelson
Copy link
Contributor

Thanks for the bug report @bvaughn ! Could you please create a plunkr which illustrates the issue? Thanks.

@bvaughn
Copy link
Author

bvaughn commented Mar 5, 2014

Sure thing! Working on that and a pull request too.

@davidjnelson
Copy link
Contributor

Awesome, thanks @bvaughn !! :-)

@bvaughn
Copy link
Author

bvaughn commented Mar 6, 2014

@davidjnelson After digging in further I've discovered that this problem is actually being caused by a non-standard response coming back from our service endpoint. My apologies! Going to close this as invalid.

@bvaughn bvaughn closed this as completed Mar 6, 2014
@bvaughn
Copy link
Author

bvaughn commented Mar 6, 2014

For information's sake, it looks like the cause of this issue is our use of the xdomain lib and a proxy.html on our service endpoint that initializes both response and responseText.

@bvaughn
Copy link
Author

bvaughn commented Mar 6, 2014

@davidjnelson I am actually a little curious why the httpBackend implementation was changed from version 1.2.3. That version did what I wish the newer version does. :)

response = xhr.responseType ? xhr.response : xhr.responseText;

Edit: I'm guessing it's because it's easier to check for 'response' than to check for 'responseText' or 'responseXML'*.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants