diff options
| author | Igor Minar | 2014-01-04 23:42:44 -0800 | 
|---|---|---|
| committer | Igor Minar | 2014-01-10 02:25:36 -0800 | 
| commit | a9cccbe14f1bd9048f5dab4443f58c804d4259a1 (patch) | |
| tree | b86682b041de5051fa2a1a354d1685e72d8a483e /src/ng/httpBackend.js | |
| parent | 36c9e42de2d78af39600c588b06f2a52199ee8b6 (diff) | |
| download | angular.js-a9cccbe14f1bd9048f5dab4443f58c804d4259a1.tar.bz2 | |
fix($http): return responseText on IE8 for requests with responseType set
Closes #4464
Closes #4738
Closes #5636
Diffstat (limited to 'src/ng/httpBackend.js')
| -rw-r--r-- | src/ng/httpBackend.js | 7 | 
1 files changed, 4 insertions, 3 deletions
| diff --git a/src/ng/httpBackend.js b/src/ng/httpBackend.js index d2806e3e..f52e4611 100644 --- a/src/ng/httpBackend.js +++ b/src/ng/httpBackend.js @@ -84,11 +84,12 @@ function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDoc            if(status !== ABORTED) {              responseHeaders = xhr.getAllResponseHeaders(); -            response = xhr.responseType ? xhr.response : xhr.responseText; + +            // responseText is the old-school way of retrieving response (supported by IE8 & 9) +            // response/responseType properties were introduced in XHR Level2 spec (supported by IE10) +            response = ('response' in xhr) ? xhr.response : xhr.responseText;            } -          // responseText is the old-school way of retrieving response (supported by IE8 & 9) -          // response/responseType properties were introduced in XHR Level2 spec (supported by IE10)            completeRequest(callback,                status || xhr.status,                response, | 
