[TIMOB-17612] Titanium Android: HTTPClient doesn't decompress gzipped data for error responses
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-01-07T19:26:40.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 4.0.0 |
Components | Android |
Labels | decompression, httpclient, module_network, parity, qe-manualtest, qe-testadded |
Reporter | Stephen Woodford |
Assignee | Ashraf Abu |
Created | 2014-09-03T18:43:36.000+0000 |
Updated | 2015-01-07T19:26:40.000+0000 |
Description
Gzipped data isn't decompressed if the response status code is >=400 (https://github.com/appcelerator/titanium_mobile/blob/master/android/modules/network/src/java/ti/modules/titanium/network/TiHTTPClient.java#L273-L275)
Whereas for response status codes <400, the response is properly decompressed.
(https://github.com/appcelerator/titanium_mobile/blob/master/android/modules/network/src/java/ti/modules/titanium/network/TiHTTPClient.java#L285)
Forgot to mention, iOS properly decompresses data in error responses, so this is a parity issue as well.
Took *FOREVER* to track this down. To hopefully help others with some google bait... The dump I get when I hit this bug:
Also, the raw response:
I have the same issue. The bug seems to be introduced in 3.3.0 with the new HTTPClient.
I was able to reproduce the bug in 3.2.1 and 3.1.2.
[~iotashan] Can you please attach raw code and probably log as file ? That black diamonds with questions marks kills email notifications in JIRA too ) . So I had to remove them.
PR: https://github.com/appcelerator/titanium_mobile/pull/6530 Test App:
Verified the fix. The gzip data gets decompressed as expected. Closing. Environment: Appc Studio : 3.4.1.201410281743 Ti SDK : 3.6.0.v20150106160923 CLI : 3.4.1 Alloy : 1.5.1 GA Code Processor : 1.1.1 MAC Yosemite : 10.10