[TIMOB-9976] MobileWeb: HttpClient in the MobileWeb drops responseText when error happens
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-07-17T15:19:22.000+0000 |
Affected Version/s | Release 2.1.0 |
Fix Version/s | Sprint 2012-15 Core, Release 3.0.0 |
Components | MobileWeb |
Labels | core, httpclient, qe-port |
Reporter | Sehyo Chang |
Assignee | Chris Barber |
Created | 2012-07-12T20:22:25.000+0000 |
Updated | 2013-01-15T13:29:07.000+0000 |
Description
1. Client make ajax request using HttpClient
2. Server return HTTP error code 4xx (for example 400) with detail error in the response body
There is no way to get response body because HttpClient perform abort after receiving error.
Here is method abort for HttpClient
abort: function() {
var c = this.constants;
c.responseText = c.responseXML = c.responseData = "";
this._completed = true;
clearTimeout(this._timeoutTimer);
--------------------- when abort happens this._xhr.reponseText is cleared --------
this.connected && this._xhr.abort();
c.readyState = this.UNSENT;
this._fireStateChange();
}
So before performing abort on xhr, the responseText should be saved.
Attachments
File | Date | Size |
---|---|---|
app.js | 2012-07-17T01:30:32.000+0000 | 1748 |
TC1061.zip | 2012-07-16T15:39:47.000+0000 | 2212223 |
Hey Sehyo, Can you please provide a small, runnable test case to reproduce this issue? Instead of providing a small part of the code, please provide something that we can run instantly, in order to get your issue resolved asap. Thanks
Attached is sample project
Attached sample project that reproduce the case. Here is instruction how to set up (1) unzip the project (2) install nginx. (3) copy nginx conf from "
Thanks Sehyo, I have moved the ticket so that the platform team can look into this issue and fix it.
Pull request: https://github.com/appcelerator/titanium_mobile/pull/2582
Can you move this to 2.1.1? since this is high priority issue for us
Closing as fixed. Tested and verified with: Titanium Studio, build: 3.0.1.201212181159 Titanium SDK, build: 3.0.O.GA iPad mini iOS 6.0 safari MacBook Pro 10.8.2 Mountain Lion Chrome 23.0