Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26549] Windows: HTTPClient: Invalid Status Codes returned

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2018-12-10T21:30:36.000+0000
Affected Version/sRelease 7.4.1
Fix Version/sRelease 8.0.0
ComponentsWindows
Labelsn/a
ReporterSamir Mohammed
AssigneeKota Iguchi
Created2018-11-13T12:03:35.000+0000
Updated2018-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/

Comments

  1. Kota Iguchi 2018-11-15

    Attempt to fix issue with liveview: https://github.com/appcelerator/titanium_mobile_windows/pull/1318
  2. Josh Longton 2018-12-10

    *FR Passed*
  3. Samir Mohammed 2018-12-11

    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

JSON Source