{ "id": "143340", "key": "TIMOB-18423", "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": "16593", "description": "Release 4.0.0", "name": "Release 4.0.0", "archived": false, "released": true, "releaseDate": "2015-05-21" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2015-02-17T19:28:42.000+0000", "created": "2015-01-21T18:24:28.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [], "issuelinks": [ { "id": "45448", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "outwardIssue": { "id": "61522", "key": "TIMOB-890", "fields": { "summary": "setting of X-Requested-With header in HTTPClient needs to be dynamic", "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 } } } }, { "id": "45101", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "111488", "key": "TIMOB-13163", "fields": { "summary": "iOS: HTTPClient setRequestHeader does not work for some headers", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2015-03-24T21:50:31.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": "h6.Issue Description\r\nWhen a Titanium HTTPClient request is opened and sent, the header \"X-Requested-With: XMLHttpRequest\" is sent with the request by default. This usually is not a problem, however, this header currently results in an error message being returned from the particular API that I'm using (shopify API). \r\nI've set this header to null in my controller code, which fixes the problem in Android, but not in iOS as the X-Requested-With header is still being set in iOS. \r\n\r\nh6.Test Case\r\n{code}\r\nvar url = 'https://shopname.myshopify.com/admin/products.json';\r\nvar client = Ti.Network.createHTTPClient({\r\n\ttimeout : 5000,\r\n\twithCredentials : true,\r\n\tvalidatesSecureCertificate : true\r\n});\r\nclient.onload = function(e) {\r\n\tTi.API.info(\"Received text!\" + this.responseText);\r\n};\r\nclient.onerror = function(e) {\r\n\tTi.API.debug(\"error\");\r\n\tTi.API.debug(e);\r\n};\r\nclient.onreadystatechange = function(e) {\r\n\tTi.API.info(\"state changed\");\r\n\tTi.API.info(this.readyState);\r\n\tTi.API.info(client.getAllResponseHeaders());\r\n\tTi.API.info(\"************\");\r\n};\r\n\r\nclient.setUsername(\"user\");\r\nclient.setPassword(\"pass\");\r\nclient.open(\"GET\", url);\r\nclient.setRequestHeader('X-Requested-With', null);\r\nclient.send();\r\n{code}\r\n\r\nh6.Request Raw Response\r\n{quote}\r\nGET /admin/products.json HTTP/1.1\r\nHost: shopname.myshopify.com\r\nX-Titanium-Id: f2e11973-5eac-4106-b95d-6690ddd8683e\r\nX-Requested-With: XMLHttpRequest\r\nProxy-Connection: keep-alive\r\nAccept: */*\r\nAccept-Encoding: gzip, deflate\r\nAccept-Language: en-us\r\nConnection: keep-alive\r\nUser-Agent: Appcelerator Titanium/3.4.1 (iPhone Simulator/8.1; iPhone OS; en_US;)\r\n{quote}", "attachment": [], "flagged": false, "summary": "iOS: HTTPClient: setRequestHeader('X-Requested-With', null) ignored in iOS", "creator": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "environment": "iOS8\r\nTitanium 3.5.0.GA & 3.6.0 CI build", "closedSprints": [ { "id": 345, "state": "closed", "name": "2015 Sprint 04 SDK", "startDate": "2015-02-14T01:00:53.297Z", "endDate": "2015-03-01T01:00:00.000Z", "completeDate": "2015-02-28T15:39:43.652Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "343562", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Pull pending against master\r\nhttps://github.com/appcelerator/titanium_mobile/pull/6645", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-02-17T18:01:17.000+0000", "updated": "2015-02-17T18:01:17.000+0000" }, { "id": "347182", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "Verified fix using:\r\n\r\nMac OSX 10.10.2\r\nTitanium SDK build: 4.0.0.v20150323131014\r\nTitanium CLI, build: 4.0.0-alpha\r\nAlloy: 1.6.0-alpha\r\nXcode 6.2\r\niPhone 6 (8.2)\r\n\r\nIf the second argument is set to null then the headers are not sent.\r\n\r\nClosing ticket.", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2015-03-24T21:50:26.000+0000", "updated": "2015-03-24T21:50:26.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }