[TIMOB-26549] Windows: HTTPClient: Invalid Status Codes returned
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-12-10T21:30:36.000+0000 |
Affected Version/s | Release 7.4.1 |
Fix Version/s | Release 8.0.0 |
Components | Windows |
Labels | n/a |
Reporter | Samir Mohammed |
Assignee | Kota Iguchi |
Created | 2018-11-13T12:03:35.000+0000 |
Updated | 2018-12-11T12:26:48.000+0000 |
Description
GET request should be returning a status of "301" or "302"; instead returns a status code of "200"
*Test case*
var xhr = Titanium.Network.createHTTPClient();
xhr.autoRedirect = false;
xhr.allResponseHeaders = true;
// what to do if it loads
xhr.onload = function(e) {
Ti.API.log('Status = ' + this.getStatus());
if (this.getStatus() == 301) {
Ti.API.log('Redirect to ' + this.getResponseHeader('location'));
} else {
Ti.API.log('This should have returned a 301 not a 200');
}
};
xhr.open('GET', 'http://google.co.nz');
xhr.send();
*Actual result:*
Following is returned:
[INFO] Status = 200
[INFO] This should have returned a 301 not a 200
*Expected result:*
Following should be returned:
[INFO] : Status = 301
[INFO] : Redirect to http://www.google.co.nz/
Attempt to fix issue with liveview: https://github.com/appcelerator/titanium_mobile_windows/pull/1318
*FR Passed*
Closing ticket, fix verified in SDK version 8.0.0.v20181210172243. Test and other information can be found at: https://github.com/appcelerator/titanium_mobile_windows/pull/1318