fix(xhr-proxy): pass modified response to interceptors
Until now we have been passing the original response to interceptors.
This CL changes this to return the modified response, since this will be
needed by the extra info feature in the case that the non-nested view is
in use.
Change-Id: I94a68c4c94ea85780acfacfb5e20da680a600b42
diff --git a/src/xhrInterceptor/XHRProxy.js b/src/xhrInterceptor/XHRProxy.js
index 97b9158..b04ef69 100644
--- a/src/xhrInterceptor/XHRProxy.js
+++ b/src/xhrInterceptor/XHRProxy.js
@@ -221,10 +221,10 @@
var interceptors =
utils.matchInterceptors('response', this.$TWPTRequestURL);
if (interceptors.length > 0) {
- this.xhr.addEventListener('load', function() {
+ this.addEventListener('load', function() {
var body = utils.getResponseJSON({
- responseType: proxyInstance.xhr.responseType,
- response: proxyInstance.xhr.response,
+ responseType: proxyInstance.responseType,
+ response: proxyInstance.response,
$TWPTRequestURL: proxyInstance.$TWPTRequestURL,
$isArrayProto: proxyInstance.$isArrayProto,
});