[TIMOB-2589] Major Regression in Android SDK 1.5 HttpClient
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:59:32.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.5.1 M01 |
Components | Android |
Labels | android, defect, httpclient, regression, reported-1.5.0 |
Reporter | Ryan Asleson |
Assignee | Don Thorp |
Created | 2011-04-15T03:23:43.000+0000 |
Updated | 2011-04-17T01:59:32.000+0000 |
Description
Hello,
I have built an Android application that uses extensive use of HttpClient to contact a remote server. The application is stable and I haven't changed any of the networking code in quite a while.
I'm eager to use the new Android features in the 1.5 SDK. After upgrading to the 1.5 SDK my application can no longer talk to the client using HttpClient.
The remote server is Tomcat. Because of ticket #968, I can't rely on the jsessionid cookie to be properly utilized by HttpClient, so to get around it, I append the jsessionid to the end of the URL as necessary. Something this:
/someurl.action;jsessionid=123456
This all worked correctly and without fail until I upgraded to the 1.5 SDK. Now, when the jsessionid is appended to the URL, Tomcat throws a 404 error with this in the error message:
The requested resource (/mwf/mobile/home/Home.action%3Bjsessionid%3D9498648CA1E54C6743AA5723276EBF51) is not available.
You can see in the error message that the semicolon before jsessionid was URL encoded, as was the equals sign after jsessionid. I don't know for sure, but I assume that pre 1.5 these characters were NOT encoded.
This is a show stopper bug for me. Due to ticket #968 I can't rely on the jsessionid cookie, and the work around of appending jsessionid to the URL is now failing too. My app effectively cannot contact the server since the session ID cannot be passed along. Maybe Tomcat is pickier than other servers, but I can't just up and change servers especially when it worked before.
Could you please investigate?
Thank you and keep up the great work on Appcelerator Titanium!!!
-Ryan
For QA, a simple app.js:
(from [bcdf46569b53be86fc029577ec5147abda6a6c17]) [#2589 state:fixed-in-qa][#1491] Add autoEncodeUrl property to HTTPClient (default=true, thus preserving current behavior). Setting to false means your url will remain untouched. Add drillbit unit tests. https://github.com/appcelerator/titanium_mobile/commit/bcdf46569b53be86fc029577ec5147abda6a6c17"> https://github.com/appcelerator/titanium_mobile/commit/bcdf46569b53...
Currently the change (.autoEncodeUrl property,which can be set to false to avoid auto-encoding) is only on master branch. If QA sets to resolve and Ralf agrees, we can cherry-pick to 1_5_X.
For Ryan, an example of using it:
Awesome, thank you so much!! I'm eager for the next release.
(from [fbc043377a7e44753497c3ec0c9979c0cb53b359]) [#2589 state:fixed-in-qa][#1491] Add autoEncodeUrl property to HTTPClient (default=true, thus preserving current behavior). Setting to false means your url will remain untouched. Add drillbit unit tests. https://github.com/appcelerator/titanium_mobile/commit/fbc043377a7e44753497c3ec0c9979c0cb53b359"> https://github.com/appcelerator/titanium_mobile/commit/fbc043377a7e...
This is now in the 1_5_X branch, ready for interim release.
Bill, using your code snippet I get the fail condition on a g1 (1.6) and using the sim (2.2)
[INFO] Titanium SDK version: 1.5.1 (12/15/10 08:16 1a59cc3)
user error on my part?
1a59cc3 is before my commit. I'm the commit after that.
damnit. sorry Bill, checked in G1 (1.6) and sim (2.2) looks good. [INFO] Titanium SDK version: 1.5.1 (12/15/10 16:41 fbc0433)