-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
XMLHttpRequestInterceptor
if (response instanceof Promise) {
this.readyState = readyState;
this.status = status;
//TODO: should 'this.response' be the response string or the response json?
response.then(function(data) {
payload = data;
if (data instanceof _Response.Response) {
var responseHeaders = data.headers;
payload = data.body;
status = data.code;
Object.assign(_this._responseHeaders, responseHeaders);
}
var responseString = JSON.stringify(payload);
_this.responseText = _this.response = responseString;
var requestDelay = helpers.getDelay();
if (!requestDelay) {
// for backwards compatibility if there is no requestDelay ot it 0 return callback without setTimeout
successCallback.call(_this);
} else {
return setTimeout(function() {
successCallback.call(_this);
},
requestDelay);
}
});
return setTimeout(function() {},
0);
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels