{ "id": "135956", "key": "TIMOB-17585", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "15972", "description": "Release 3.4.0", "name": "Release 3.4.0", "archived": false, "released": true, "releaseDate": "2014-09-28" }, { "id": "16704", "description": "Release 3.5.0", "name": "Release 3.5.0", "archived": false, "released": true, "releaseDate": "2015-01-13" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-09-15T17:37:34.000+0000", "created": "2014-09-01T22:18:50.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "TCSupport", "module_network", "qe-testadded" ], "versions": [ { "id": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" } ], "issuelinks": [ { "id": "40799", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "outwardIssue": { "id": "134598", "key": "TIMOB-17584", "fields": { "summary": "iOS: HTTPClient: AutoRedirect = false returns 200 status code, not 301/302", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "56988", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "172601", "key": "TIMOB-26549", "fields": { "summary": "Windows: HTTPClient: Invalid Status Codes returned", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-11-13T12:03:35.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h4. Problem Description\r\nWhen a GET request should be returning a status of \"301\" or \"302\", I have the 3.3.0 GA SDK returning a \"200\".\r\n\r\nSwitching back to the 3.2.3 GA SDK fixes the problem.\r\n\r\nWhen we have tested using the following code, the status returned is \"302\" in 3.3.0.GA and \"301\" in 3.2.3.GA.\r\n \r\nh4. Steps to reproduce \r\n a) Create a simple project.\r\n b) Update this code in app.js:\r\n\r\n{code}var xhr = Titanium.Network.createHTTPClient();\r\nxhr.autoRedirect = false;\r\nxhr.allResponseHeaders = true;\r\n\r\n// what to do if it loads\r\nxhr.onload = function(e) {\r\n\r\n\tTi.API.log('Status = ' + this.getStatus());\r\n\r\n\tif (this.getStatus() == 301) {\r\n\t\tTi.API.log('Redirect to ' + this.getResponseHeader('location'));\r\n\t} else {\r\n\t\tTi.API.log('This should have returned a 301 not a 200');\r\n\t}\r\n};\r\n\r\nxhr.open('GET', 'http://google.co.nz');\r\nxhr.send();{code}\r\n\r\n c) Run this with testing environment\r\n \r\n\r\n\r\nh4. Test results\r\n\r\nIn Titanium SDK: 3.3.0.GA \r\n\r\n[DEBUG]: Application booted in 125.191987 ms\r\n[INFO] : Status = 302\r\n[INFO] : This should have returned a 301 not a 200\r\n\r\nIn Titanium SDK: 3.2.3.GA \r\n\r\n[DEBUG]: Application booted in 110.395968 ms\r\n[INFO] : Status = 301\r\n[INFO] : Redirect to http://www.google.co.nz/\r\n", "attachment": [], "flagged": false, "summary": "Android: HTTPClient: Invalid Status Codes returned in 3.3.0.GA SDK", "creator": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "subtasks": [], "reporter": { "name": "mdelmarter", "key": "mdelmarter", "displayName": "Matthew Delmarter", "active": true, "timeZone": "Pacific/Auckland" }, "environment": " Titanium SDK: 3.3.0.GA and 3.2.3.GA\r\n Titanium CLI: 3.3.0\r\n OS X Version: 10.9.3\r\n iOS Simulator: 7.1\r\n Xcode Version: 5.1.1\r\n Android API Level: 17 and 19\r\n", "closedSprints": [ { "id": 199, "state": "closed", "name": "2014 Sprint 18 SDK", "startDate": "2014-09-02T22:56:57.421Z", "endDate": "2014-09-13T00:00:00.000Z", "completeDate": "2014-09-15T20:08:19.146Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "321384", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~emerriman] To find duplicate.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-09-02T18:27:01.000+0000", "updated": "2014-09-02T18:27:01.000+0000" }, { "id": "323002", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master PR: https://github.com/appcelerator/titanium_mobile/pull/6053\r\n3.4.X PR: https://github.com/appcelerator/titanium_mobile/pull/6054", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-09-11T06:11:38.000+0000", "updated": "2014-09-11T06:15:11.000+0000" }, { "id": "323390", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix.\r\n\r\nThe right code is returned as below:\r\n{code}\r\n[INFO] : Status = 301\r\n[INFO] : Redirect to http://www.google.co.nz/\r\n{code}\r\n\r\nClosing.\r\n\r\nEnvironment:\r\nAppc Studio : 3.4.0.201409112242\r\nTi SDK : 3.4.0.v20140912084114 \r\nMac OSX : 10.9.4\r\nAlloy : 1.5.0-rc\r\nCLI - 3.4.0-rc2\r\nCode Processor: 1.1.1\r\nGalaxy S4 - android 4.4.2", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-09-12T18:45:16.000+0000", "updated": "2014-09-12T18:45:16.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }