You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this.put('some-url', function (req) {
return [0, "error", ''];
});
Buuut, in my response handler, I got statusCode = 200. After some debugging, I discovered that, it's because of new jquery(my version is 3.3.1), that has some code like below:
complete(
xhrSuccessStatus[ xhr.status ] || xhr.status,
xhr.statusText,
// Support: IE <=9 only
// IE9 has no XHR2 but throws on binary (trac-11426)
// For XHR2 non-text, let the caller handle it (gh-2498)
( xhr.responseType || "text" ) !== "text" ||
typeof xhr.responseText !== "string" ?
{ binary: xhr.response } :
{ text: xhr.responseText },
xhr.getAllResponseHeaders()
);
where xhrSuccessStatus equals:
var xhrSuccessStatus = {
// File protocol always yields status code 0, assume 200
0: 200,
// Support: IE <=9 only
// #1450: sometimes IE returns 1223 when it should be 204
1223: 204
}
So, when xhr.status eqauls 0, I got status as 200.
any minds about that?
probably, someone has any workarounds for that?
Thanks!
The text was updated successfully, but these errors were encountered:
I tried to mock response like below:
Buuut, in my response handler, I got statusCode = 200. After some debugging, I discovered that, it's because of new jquery(my version is 3.3.1), that has some code like below:
where
xhrSuccessStatus
equals:So, when
xhr.status
eqauls 0, I gotstatus
as 200.any minds about that?
probably, someone has any workarounds for that?
Thanks!
The text was updated successfully, but these errors were encountered: