Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http post 请求结果里会把所有表示错误的 status 改成 404? #2

Open
cupen opened this issue Aug 17, 2021 · 0 comments
Open

Comments

@cupen
Copy link

cupen commented Aug 17, 2021

我碰到个问题,服务端返回了 401, 但客户端收到 404.
同事顺藤摸瓜找到这段疑似问题的代码。

var onPostError = function (e1, e2) {
var _t = this._t;
_t._readyState = 4;
_t._status = 404;
_t.xhr._changeState(4);
if (_t.onerror) {
var ev = new _lbEvent("error");
ev.target = _t;
ev['ecode1'] = e1;
ev['ecode2'] = e2;
_t.onerror(ev);
}
onPostLoad.ref = onPostError.ref = null;
};

401 和 404 有着完全不同的含义,会导致开发人员误判问题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant