Skip to content

Commit 163e1ad

Browse files
gonzaloruizdevillaGonzalo Ruiz de Villa
authored and
Gonzalo Ruiz de Villa
committed
fix(httpBackend): use of reponseText is redundant and buggy
fixes angular#1922 Signed-off-by: Gonzalo Ruiz de Villa <[email protected]>
1 parent 2508b47 commit 163e1ad

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/ng/httpBackend.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function createHttpBackend($browser, XHR, $browserDefer, callbacks, rawDocument,
8787
}
8888
// end of the workaround.
8989

90-
completeRequest(callback, status || xhr.status, xhr.response || xhr.responseText,
90+
completeRequest(callback, status || xhr.status, xhr.response,
9191
responseHeaders);
9292
}
9393
};

test/ng/httpBackendSpec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ describe('$httpBackend', function() {
110110

111111
this.send = function() {
112112
this.status = 200;
113-
this.responseText = 'response';
113+
this.response = 'response';
114114
this.readyState = 4;
115115
this.onreadystatechange();
116116
};
@@ -248,7 +248,7 @@ describe('$httpBackend', function() {
248248
function respond(status, content) {
249249
xhr = MockXhr.$$lastInstance;
250250
xhr.status = status;
251-
xhr.responseText = content;
251+
xhr.response = content;
252252
xhr.readyState = 4;
253253
xhr.onreadystatechange();
254254
}

0 commit comments

Comments
 (0)