{ "id": "122302", "key": "AC-2400", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-11-22T22:20:09.000+0000", "created": "2013-11-11T18:23:41.000+0000", "labels": [ "alloy", "encoding", "httpclient", "ios", "ios7", "redirect", "url" ], "versions": [], "issuelinks": [ { "id": "33347", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "122409", "key": "TIMOB-15871", "fields": { "summary": "HTTPClient: setting autoRedirect off for 302s on Android calls onerror", "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": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "updated": "2016-03-08T07:41:26.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": "14544", "name": "Alloy", "description": "Please enter tickets related to the Alloy here." } ], "description": "When trying to GET something which returns a 301, if I set autoEncodeURL to false (via the setter or directly), set autoRedirect to true (or leave it default to that), then the value of the location header returned is encoded before being followed.\r\n\r\nTo get around this, I had to set autoRedirect to false. Then in the success callback, get the value of the location header returned and issue another GET manually (with autoEncodeURL set to false).\r\n\r\nEdit:\r\nThis doesn't seem to be a problem on Android", "attachment": [], "flagged": false, "summary": "iOS: HTTPClient: autoEncodeURL not used when redirect is followed", "creator": { "name": "adamlynch", "key": "adamlynch", "displayName": "Adam Lynch", "active": true, "timeZone": "Europe/London" }, "subtasks": [], "reporter": { "name": "adamlynch", "key": "adamlynch", "displayName": "Adam Lynch", "active": true, "timeZone": "Europe/London" }, "environment": "I came across the problem in the iPhone (iOS7) simulator but probably a general problem. (Titanium 3.1.2)", "comment": { "comments": [ { "id": "279316", "author": { "name": "adamlynch", "key": "adamlynch", "displayName": "Adam Lynch", "active": true, "timeZone": "Europe/London" }, "body": "This doesn't seem to be a problem on Android", "updateAuthor": { "name": "adamlynch", "key": "adamlynch", "displayName": "Adam Lynch", "active": true, "timeZone": "Europe/London" }, "created": "2013-11-13T11:14:20.000+0000", "updated": "2013-11-13T11:14:20.000+0000" }, { "id": "280515", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello,\r\n\r\nWe have tested this issue with sample below. We can’t reproduce this problem. \r\n\r\nIf you continue to encounter the error, please send us your test code and steps to reproduce. We look forward to your feedback.\r\n\r\nRegards,\r\n\r\nh5. Test environment: \r\n\r\nOS: MAC OS X 10.8.5\r\n \r\nTi SDK: 3.1.3 GA \r\nTi CLI: 3.2.0\r\nIOS simulator 7.0\r\n\r\nh5. Test Sample \r\n{code:javascript}\r\nvar win1 = Titanium.UI.createWindow({\r\n\t \r\n});\r\n\r\n// Create a Button.\r\nvar aButton = Ti.UI.createButton({\r\n\ttitle : 'aButton',\r\n});\r\n\r\n// Listen for click events.\r\naButton.addEventListener('click', function() {\r\n\r\n\tvar url = \"http://www.example.com/redirect.php\";\r\n\tvar client = Ti.Network.createHTTPClient({\r\n\t\t// function called when the response data is available\r\n\t\tonload : function(e) {\r\n\t\t\tTi.API.info('e ' + JSON.stringify(e));\r\n\t\t\tTi.API.info(\"Received HEADERS_RECEIVED: \" + this.HEADERS_RECEIVED);\r\n\t\t\tTi.API.info(\"Received status: \" + this.status);\r\n\t\t\tTi.API.info(\"Received statusText: \" + this.statusText);\r\n\t\t\tTi.API.info(\"Received responseText: \" + this.responseText);\r\n\r\n\t\t\talert('success');\r\n\t\t},\r\n\t\t// function called when an error occurs, including a timeout\r\n\t\tonerror : function(e) {\r\n\t\t\tTi.API.debug(e.error);\r\n\t\t\tTi.API.info(\"Received HEADERS_RECEIVED: \" + this.HEADERS_RECEIVED);\r\n\t\t\tTi.API.info(\"Received status: \" + this.status);\r\n\t\t\tTi.API.info(\"Received statusText: \" + this.statusText);\r\n\t\t\tTi.API.info(\"Received responseText: \" + this.responseText);\r\n\r\n\t\t\talert('error');\r\n\t\t},\r\n\t\ttimeout : 5000, // in milliseconds\r\n\t\tautoRedirect : true,\r\n\t\tautoEncodeUrl : false,\r\n\r\n\t});\r\n\t// Prepare the connection.\r\n\r\n\tclient.open(\"GET\", url);\r\n\t// Send the request.\r\n\tclient.send();\r\n\r\n});\r\n\r\n// Add to the parent view.\r\nwin1.add(aButton);\r\n\r\nwin1.open();\r\n{code} \r\n\r\n\r\nh5. Server side code\r\n{code:php }\r\n\r\n{code}\r\n\r\nh5. Step to reproduces\r\n1.\tCreate a new project\r\n2.\tPaste test code in app.js\r\n3.\tNow run on iOS 7 with simulator 7.0 \r\n4.\tClick on button its return success \r\n\r\n\r\n\r\n\r\n", "updateAuthor": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-11-21T08:31:24.000+0000", "updated": "2013-11-21T16:46:53.000+0000" }, { "id": "280827", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Tested in 3.1.3, works as expected.", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2013-11-22T23:41:00.000+0000", "updated": "2013-11-22T23:41:00.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }