-
Notifications
You must be signed in to change notification settings - Fork 487
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
bug fix #505
bug fix #505
Conversation
Updated to follow the spec (http://www.w3.org/TR/XMLHttpRequest/)
_errorFlag = true; | ||
_status = 0; | ||
_statusText.clear(); | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @seobyeongky , if statusCode
is 0
, why don't we need to notify JS that there is an error triggered?
Here, we just return without any notifications to JS.
Yeah, I concerned about that!.... Because the original cocos's XMLHttpRequest notifies network error events. But According to the spec(http://www.w3.org/TR/XMLHttpRequest/), The readyStatus value is one of following values UNSENT(0), OPENED(1), HEADERS_RECEIVED(2), LOADING(3), DONE(4). And there is no error or timeout state. And the event that changes to UNSENT should not be notified. That means no notification. It should be an "onerror" callback, and I didn't added it. Sorry about that! I didn't notice about this issue. I will add it soon! |
Thanks. I need this feature in my project, when will you send another PR for this feature? |
My plan is finish it until tomorrow. |
Great. I will be waiting for this fix. :) |
Updated to follow the spec (http://www.w3.org/TR/XMLHttpRequest/)