{ "id": "63221", "key": "TIMOB-2589", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "11232", "name": "Release 1.5.1 M01", "archived": true, "released": true, "releaseDate": "2010-12-20" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T01:59:32.000+0000", "created": "2011-04-15T03:23:43.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "defect", "httpclient", "regression", "reported-1.5.0" ], "versions": [], "issuelinks": [], "assignee": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-04-17T01:59:32.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "{html}

Hello,

\n

I have built an Android application that uses extensive use of\nHttpClient to contact a remote server. The application is stable\nand I haven't changed any of the networking code in quite a\nwhile.

\n

I'm eager to use the new Android features in the 1.5 SDK. After\nupgrading to the 1.5 SDK my application can no longer talk to the\nclient using HttpClient.

\n

The remote server is Tomcat. Because of ticket #968, I can't\nrely on the jsessionid cookie to be properly utilized by\nHttpClient, so to get around it, I append the jsessionid to the end\nof the URL as necessary. Something this:

\n

/someurl.action;jsessionid=123456

\n

This all worked correctly and without fail until I upgraded to\nthe 1.5 SDK. Now, when the jsessionid is appended to the URL,\nTomcat throws a 404 error with this in the error message:

\n

The requested resource\n(/mwf/mobile/home/Home.action%3Bjsessionid%3D9498648CA1E54C6743AA5723276EBF51)\nis not available.

\n

You can see in the error message that the semicolon before\njsessionid was URL encoded, as was the equals sign after\njsessionid. I don't know for sure, but I assume that pre 1.5 these\ncharacters were NOT encoded.

\n

This is a show stopper bug for me. Due to ticket #968 I can't\nrely on the jsessionid cookie, and the work around of appending\njsessionid to the URL is now failing too. My app effectively cannot\ncontact the server since the session ID cannot be passed along.\nMaybe Tomcat is pickier than other servers, but I can't just up and\nchange servers especially when it worked before.

\n

Could you please investigate?

\n

Thank you and keep up the great work on Appcelerator\nTitanium!!!

\n

-Ryan

{html}", "attachment": [], "flagged": false, "summary": "Major Regression in Android SDK 1.5 HttpClient", "creator": { "name": "ryanasleson", "key": "ryanasleson", "displayName": "Ryan Asleson", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "ryanasleson", "key": "ryanasleson", "displayName": "Ryan Asleson", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "128888", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

For QA, a simple app.js:

\n
\nvar xhr = Ti.Network.createHTTPClient();\nxhr.autoEncodeUrl = false;\nxhr.open('GET','http://www.appcelerator.com/x/y/z;jsessionid=ABCD');\nif (xhr.location.indexOf(';jsession')<0) {\n    alert('FAIL.  Cannot find \";jsessionid\" in location url: ' + xhr.location);\n} else {\n    alert('SUCCESS.  Found \";jsessionid\" in location url: ' + xhr.location);\n}\n
{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:23:44.000+0000", "updated": "2011-04-15T03:23:44.000+0000" }, { "id": "128889", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

(from [bcdf46569b53be86fc029577ec5147abda6a6c17])\n[#2589 state:fixed-in-qa][#1491] Add\nautoEncodeUrl property to HTTPClient (default=true, thus preserving\ncurrent behavior). Setting to false means your url will remain\nuntouched. Add drillbit unit tests. \nhttps://github.com/appcelerator/titanium_mobile/commit/bcdf46569b53...

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:23:45.000+0000", "updated": "2011-04-15T03:23:45.000+0000" }, { "id": "128890", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

Currently the change (.autoEncodeUrl property,which can be set\nto false to avoid auto-encoding) is only on master branch. If QA\nsets to resolve and Ralf agrees, we can cherry-pick to 1_5_X.

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:23:45.000+0000", "updated": "2011-04-15T03:23:45.000+0000" }, { "id": "128891", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

For Ryan, an example of using it:

\n
\nvar xhr = Titanium.Network.createHTTPClient;\nxhr.autoEncodeUrl = false; // do this before calling .open()\nxhr.open('GET', 'http://myhost.com/someurl.action;jsessionid=123456');\nxhr.send();\n
{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:23:45.000+0000", "updated": "2011-04-15T03:23:45.000+0000" }, { "id": "128892", "author": { "name": "ryanasleson", "key": "ryanasleson", "displayName": "Ryan Asleson", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Awesome, thank you so much!! I'm eager for the next release.

{html}", "updateAuthor": { "name": "ryanasleson", "key": "ryanasleson", "displayName": "Ryan Asleson", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:23:45.000+0000", "updated": "2011-04-15T03:23:45.000+0000" }, { "id": "128893", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

(from [fbc043377a7e44753497c3ec0c9979c0cb53b359])\n[#2589 state:fixed-in-qa][#1491] Add\nautoEncodeUrl property to HTTPClient (default=true, thus preserving\ncurrent behavior). Setting to false means your url will remain\nuntouched. Add drillbit unit tests. \nhttps://github.com/appcelerator/titanium_mobile/commit/fbc043377a7e...

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:23:45.000+0000", "updated": "2011-04-15T03:23:45.000+0000" }, { "id": "128894", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

This is now in the 1_5_X branch, ready for interim release.

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:23:46.000+0000", "updated": "2011-04-15T03:23:46.000+0000" }, { "id": "128895", "author": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Bill, using your code snippet I get the fail condition on a g1\n(1.6) and using the sim (2.2)
\n[INFO] Titanium SDK version: 1.5.1 (12/15/10\n08:16 1a59cc3)

\n

user error on my part?

{html}", "updateAuthor": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:23:46.000+0000", "updated": "2011-04-15T03:23:46.000+0000" }, { "id": "128896", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

1a59cc3 is before my commit. I'm the commit after that.

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:23:46.000+0000", "updated": "2011-04-15T03:23:46.000+0000" }, { "id": "128897", "author": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

damnit. sorry Bill, checked in G1 (1.6) and sim (2.2) looks\ngood. [INFO] Titanium SDK version: 1.5.1 (12/15/10\n16:41 fbc0433)

{html}", "updateAuthor": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:23:46.000+0000", "updated": "2011-04-15T03:23:46.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }