[TIMOB-13328] Android: HTTP Client does not properly handle server redirects
GitHub Issue | n/a |
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2020-01-09T22:13:20.000+0000 |
Affected Version/s | Release 2.1.4 |
Fix Version/s | n/a |
Components | Android |
Labels | hard_to_verify |
Reporter | Miles Lyon |
Assignee | Unknown |
Created | 2012-09-25T19:55:09.000+0000 |
Updated | 2020-01-09T22:13:20.000+0000 |
Description
Note: You will need to set up your own web server redirect to verify this issue.
Our webserver includes a 302 redirect response to adjust the webservice location our application points to. This would allow us to make an updated version of the webservices and point production mobile apps to the new web service URLs as needed.
This works fine with our application under iOS, but unfortunately the Android version of the HTTP Client appears to be interpretting a 302 response as a 404 not found error and does not contain the proper response headers at any point. Specifically we need to pull out the location response header.
We tried checking at any readyStateChange event as well, but the response is never updated with the correct information.
Monitoring the actual http request with Wireshark we can see that the request and response are what they should be. The server responds with the following:
HTTP/1.1 302 Moved Temporarily
Server: Apache-Coyote/1.1
Location: [***OUR ACTUAL DESIRED SERVER URL***]
Content-Length: 0
Date: Tue, 25 Sep 2012 18:26:12 GMT
Connection: close
However, the HTTP client instead throws a 404 (not found) error.
The attached http client code is small (there doesn't need to be much to see what is happening), but shows what we are trying to do.
Attachments
No comments