[TIMOB-2339] Android Response Headers BUG
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Trivial |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:58:49.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.5.0 M05 |
Components | Android |
Labels | android, defect, rplist |
Reporter | Android3000 |
Assignee | Don Thorp |
Created | 2011-04-15T03:17:07.000+0000 |
Updated | 2011-04-17T01:58:49.000+0000 |
Description
ANDROID HTTPCLIENT BUG!
Source:
android/modules/network/src/ti/modules/titanium/network/TiHTTPClient.java
In line #625 should be: response object instead of request:
public String getAllResponseHeaders() {
String result = "";
if (readyState >= READY_STATE_HEADERS_RECEIVED)
{
StringBuilder sb = new StringBuilder(1024);
*===> Header[] headers = request.getAllHeaders();
int len = headers.length;
for(int i = 0; i < len; i++) {
Header h = headers[i];
sb.append(h.getName()).append(":").append(h.getValue()).append("\n");
}
result = sb.toString();
} else {
// Spec says return "";
}
return result;
}
Maybe it should be changed in 1.4.X versions too.
Thanks
IOS code is incorrect too!
simple failcase app.js. Check logcat and you'll see only request headers are there.
(from [4f2561249677572219e50bfa7483c029da2953fd]) [#2339 state:fixed-in-qa] getAllResponseHeaders was actually returning request headers https://github.com/appcelerator/titanium_mobile/commit/4f2561249677572219e50bfa7483c029da2953fd"> https://github.com/appcelerator/titanium_mobile/commit/4f2561249677...
Titanium SDK version: 1.5.0 (12/07/10 10:00 8f4eea3...), bugTest, Android 1.6, 2.1