[TIMOB-17460] iOS: Ti.Network.createHTTPClient autoRedirect = false is ignored
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2014-10-21T16:18:42.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | TiAPI |
Labels | ios |
Reporter | k |
Assignee | Muhammad Dadu |
Created | 2014-07-27T06:09:39.000+0000 |
Updated | 2017-03-21T22:08:34.000+0000 |
Description
Here is why and how it can be fixed.
https://github.com/appcelerator/APSHTTPClient/pull/16
I debugged why autoRedirect property of Ti.Network.createHTTPClient is ignored for 3.3.0.GA. The default property of autoRedirect is true.
When autoRedirect = false is set, self.response.status is always zero in APSHTTPRequest.m
Therefore the redirect check if statement
if (!self.redirects && self.response.status != 0)
does always fall through.
[self.response updateResponseParamaters:response];
needs to be called in advance
3.4.0 is moved forward, and 3.5.0 is taking its place in the calendar.
One thing to note, I was not able to reproduce this issue on iOS. The autoRedirect property is respected: * If autoRedirect = true, then the target url will be auto-redirected and return status 200 * If autoRedirect = false, then the target url will not be auto-redirected and return status 302 *Tested on:* Appcelerator Studio, build: 3.3.0.201407111535 SDK build: 3.3.0.GA CLI: 3.3.0 Alloy: 1.4.1 Xcode: 5.1.1 Devices: iphone 5 (7.1.1) And, here is the app.js I used to verify this ticket:
[~kazuyukitanimura@gmail.com] Can you reproduce it with the code listed above?
Can't reproduce this issue. Tested using [~wluu]'s example code above.
Environment
TiSDK 3.4.0.GA iOS Sim 8.0 TiSDK 3.3.0.GA iPhone 5S iOS 8.0.2 [~kazuyukitanimura@gmail.com] please test using the example code above without your fix and let us know your results. Thank you!Can not reproduce with sample code provided.
Closing ticket as the issue cannot be reproduced and due to the above comments.