{ "id": "161674", "key": "TIMOB-23623", "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": "16980", "description": "New V8", "name": "Release 6.0.0", "archived": false, "released": true, "releaseDate": "2016-11-15" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-07-12T04:23:02.000+0000", "created": "2016-07-11T19:40:26.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "parity" ], "versions": [ { "id": "17706", "name": "Release 5.4.0", "archived": false, "released": true, "releaseDate": "2016-08-11" } ], "issuelinks": [ { "id": "52190", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "outwardIssue": { "id": "161673", "key": "TIMOB-23622", "fields": { "summary": "Android: Unable to set Ti.userAgent", "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": "52191", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "inwardIssue": { "id": "161675", "key": "TIMOB-23624", "fields": { "summary": "iOS: Ti.userAgent ignored for Ti.Network.HTTPClient operations", "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 } } } } ], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2017-03-23T18:09:10.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "The documentation says that we can set Ti.userAgent via a setter method: http://docs.appcelerator.com/platform/latest/#!/api/Titanium-property-userAgent\r\n\r\nThat method does not exist on iOS.", "attachment": [], "flagged": false, "summary": "iOS: Ti.setUserAgent() doesn't exist", "creator": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "environment": null, "closedSprints": [ { "id": 678, "state": "closed", "name": "2016 Sprint 14 SDK", "startDate": "2016-07-02T00:25:57.921Z", "endDate": "2016-07-16T00:25:00.000Z", "completeDate": "2016-07-18T03:18:29.729Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "390359", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "https://github.com/appcelerator/titanium-mobile-mocha-suite/blob/master/Resources/ti.test.js#L76", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2016-07-11T19:44:44.000+0000", "updated": "2016-07-11T19:44:44.000+0000" }, { "id": "390367", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/8122\r\n\r\nThe demo starts three requests:\r\n1) Using the system-default user-agent (e.g. \"Appcelerator Titanium\\/0.0.0 (iPhone\\/9.0; iPhone OS; en_US;\\)\")\r\n2) Override the default user-agent with \"my-custom-user-agent\"\r\n3) Leave the current (custom) user-agent, but se the request-header \"User-Agent\". It will throw a warning about duplicate user-agents and the APSHTTPClient will concatenate the user-agents.\r\n\r\nDemo:\r\n{code:javascript}\r\nTi.API.warn(Ti.getUserAgent());\r\n\r\nTi.UI.createWindow().open();\r\n\r\n// 1 ---- Use the default Appc user agent\r\n\r\nvar url = \"http://hans-knoechel.de/ua.php\";\r\nvar client = Ti.Network.createHTTPClient({\r\n\t// function called when the response data is available\r\n\tonload : function(e) {\r\n\t\tTi.API.info(\"First request completed\");\r\n\t\tTi.API.info(\"Received text: \" + this.responseText);\r\n\t\t\r\n\t\t// 2 ---- This time, set the Ti.userAgent manually.\r\n\t\t\r\n\t\tTi.setUserAgent(\"my-custom-user-agent\");\r\n\t\tTi.API.warn(Ti.getUserAgent());\r\n\t\t\r\n\t\tvar url2 = \"http://hans-knoechel.de/ua.php\";\r\n\t\tvar client2 = Ti.Network.createHTTPClient({\r\n\t\t\t// function called when the response data is available\r\n\t\t\tonload : function(e) {\r\n\t\t\t\tTi.API.info(\"Second request completed\");\r\n\t\t\t\tTi.API.info(\"Received text: \" + this.responseText);\r\n\t\t\t\t\r\n\t\t\t\tvar url3 = \"http://hans-knoechel.de/ua.php\";\r\n\t\t\t\tvar client3 = Ti.Network.createHTTPClient({\r\n\t\t\t\t\t// function called when the response data is available\r\n\t\t\t\t\tonload : function(e) {\r\n\t\t\t\t\t\tTi.API.info(\"Third request completed\");\r\n\t\t\t\t\t\tTi.API.info(\"Received text: \" + this.responseText);\r\n\t\t\t\t\t},\r\n\t\t\t\t\t// function called when an error occurs, including a timeout\r\n\t\t\t\t\tonerror : function(e) {\r\n\t\t\t\t\t\tTi.API.debug(e.error);\r\n\t\t\t\t\t\talert('error');\r\n\t\t\t\t\t},\r\n\t\t\t\t\ttimeout : 5000 // in milliseconds\r\n\t\t\t\t});\r\n\t\t\t\t// Prepare the connection.\r\n\t\t\t\tclient3.open(\"GET\", url3);\r\n\t\t\t\t\r\n\t\t\t\t// 3 ---- This time, override the request header inside the http client (highist prio)\r\n\t\t\t\tclient3.setRequestHeader('User-Agent', 'another-user-agent');\r\n\r\n\t\t\t\t// Send the request.\r\n\t\t\t\tclient3.send();\t\r\n\t\t\t\t\r\n\t\t\t},\r\n\t\t\t// function called when an error occurs, including a timeout\r\n\t\t\tonerror : function(e) {\r\n\t\t\t\tTi.API.debug(e.error);\r\n\t\t\t\talert('error');\r\n\t\t\t},\r\n\t\t\ttimeout : 5000 // in milliseconds\r\n\t\t});\r\n\t\t// Prepare the connection.\r\n\t\tclient2.open(\"GET\", url2);\r\n\t\t// Send the request.\r\n\t\tclient2.send();\t\r\n\t},\r\n\t// function called when an error occurs, including a timeout\r\n\tonerror : function(e) {\r\n\t\tTi.API.debug(e.error);\r\n\t\talert('error');\r\n\t},\r\n\ttimeout : 5000 // in milliseconds\r\n});\r\n\r\n// Prepare the connection.\r\nclient.open(\"GET\", url);\r\n// Send the request.\r\nclient.send();\r\n{code}", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-07-11T20:53:28.000+0000", "updated": "2016-07-11T20:53:57.000+0000" }, { "id": "390425", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "APPROVED", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-07-12T04:22:48.000+0000", "updated": "2016-07-12T04:22:48.000+0000" }, { "id": "415322", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as fixed with reference to the above comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-23T18:09:10.000+0000", "updated": "2017-03-23T18:09:10.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }