{ "id": "123068", "key": "TIMOB-15854", "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": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2014-07-22T19:52:11.000+0000", "created": "2013-12-02T11:13:56.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "qe-3.2.0", "qe-3.2.3", "qe-3.3.0" ], "versions": [ { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" }, { "id": "15971", "description": "Release 3.2.3", "name": "Release 3.2.3", "archived": false, "released": true, "releaseDate": "2014-04-30" } ], "issuelinks": [ { "id": "36520", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "120619", "key": "TIMOB-15380", "fields": { "summary": "Android: HTTPClient location not updated when page redirects", "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": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-29T21:41:16.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": "HTTPClient returns null as responseText when location updated on page redirects.\r\n{code}\r\nvar videoURL = \"http://api.playonsports.com/v1/videos/65601.hls?Authorization=bearer%2051033058bb53a691ccc7df4340271f29\";\r\n \r\nvar client = Ti.Network.createHTTPClient({\r\n onload : function(e) {\r\n Ti.API.debug(\"event.js -> android video check -> received text: \" + this.responseText);\r\n Ti.API.debug(\"event.js -> location: \" + this.location);\r\n Ti.API.debug(\"event.js -> headers: \" + this.getAllResponseHeaders());\r\n \r\n var win = Ti.UI.createWindow({\r\n \tbackgroundColor: 'green'\r\n });\r\n\r\n var activeMovie = Ti.Media.createVideoPlayer({\r\n url : this.location,\r\n backgroundColor : '#000',\r\n mediaControlStyle : Ti.Media.VIDEO_CONTROL_DEFAULT,\r\n scalingMode : Ti.Media.VIDEO_SCALING_ASPECT_FILL,\r\n fullscreen : true,\r\n autoplay : true\r\n });\r\n \r\n win.add(activeMovie);\r\n \r\n win.open();\r\n },\r\n onerror : function(e) {\r\n Ti.API.debug(\"event.js -> \" + e.error);\r\n alert('Unable to play video.');\r\n },\r\n timeout : 5000\r\n});\r\nclient.open(\"HEAD\", videoURL);\r\nclient.send(); \r\n{code}\r\n\r\nResult:\r\nVideo is not getting played.\r\n\r\nconsole log:\r\nevent.js -> android video check -> received text:null\r\n\r\nThis is not a regression as also not working for 3.1.3.GA also.\r\n", "attachment": [ { "id": "47196", "filename": "expected.png", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-04-08T23:31:30.000+0000", "size": 2375010, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS: HTTPClient returns null as responseText when location updated on page redirects", "creator": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Tested Environment:\r\n\r\nAppcelerator Studio: 3.2.0.201311272052, 3.2.3.201403271839\r\nSDK:3.2.0.v20131127194046, 3.2.3.v20140403105720, 3.3.0.v20140407144\r\nalloy: 1.3.0-beta, 1.3.1\r\nacs: 1.0.9\r\nnpm: 1.3.2\r\ntitanium: 3.2.0-beta, 3.2.3-alpha2\r\ntitanium-code-processor: 1.1.0-beta\r\nXcode:5.0.2, 5.1\r\nOS: Mac OSX 10.9\r\nDevice: iphone5(V7.0.4), iphone 4 (7.1), iphone 5 (7.0)", "closedSprints": [ { "id": 154, "state": "closed", "name": "2014 Sprint 15 SDK", "startDate": "2014-07-21T21:56:31.515Z", "endDate": "2014-08-02T00:00:00.000Z", "completeDate": "2014-08-04T21:03:51.067Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "300160", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "This bug is still reproducible. this.responseText is returning undefined when testing against the master SDK build (3.3.0.v20140407144327); this.responseText returns null when tested against SDK build 3.2.3.v20140403105720.\r\n\r\nTested on:\r\n\r\nAppcelerator Studio, build: 3.2.3.201403271839\r\nSDK build: 3.2.3.v20140403105720, 3.3.0.v20140407144327\r\nCLI: 3.2.3-alpha2\r\nAlloy: 1.3.1\r\nXcode: 5.1\r\nDevices: iphone 4 (7.1), iphone 5 (7.0)", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-04-08T00:24:26.000+0000", "updated": "2014-04-08T00:28:54.000+0000" }, { "id": "300316", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Marking as invalid. The url provided redirects to another url with empty content. There is no response text or response data.", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-04-08T23:05:09.000+0000", "updated": "2014-04-08T23:05:09.000+0000" }, { "id": "300318", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Reopening this ticket. The url provided redirects to another url, but the content is still available (see expected.png) and responseText will still return null (in SDK 3.2.3) or undefined (in SDK 3.3.0). \r\n\r\nI've updated the above sample code which will open the video player in a new window.", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-04-08T23:22:47.000+0000", "updated": "2014-04-08T23:32:43.000+0000" }, { "id": "300328", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Also, tried the above sample code on Samsung Galaxy S3 (4.3) with SDK build 3.2.3.v20140403105720 and get this in the logcat:\n\n{code}\nD/TiAPI ( 8208): event.js -> android video check -> received text: #EXTM3U\nD/TiAPI ( 8208): event.js -> location: http://vod.nfhsnetwork.com/63871-VNSshf/63871.m3u8\nD/TiAPI ( 8208): event.js -> headers: Content-Type:application/vnd.apple.mpegurl\n{code}\n\nIn Xcode console, you will get this:\n{code}\nevent.js -> android video check -> received text: null\nevent.js -> location: http://vod.nfhsnetwork.com/63871-VNSshf/63871.m3u8\nevent.js -> headers: undefined\n{code}", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-04-09T00:33:12.000+0000", "updated": "2014-04-09T00:33:12.000+0000" }, { "id": "315323", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Essentially what is happening is that the request to the original URL is redirecting with a 301 Code.\r\n\r\nOn Android the request is redirected with method set to GET. (no idea why)\r\nOn iOS the request is redirected with the method still HEAD.\r\n\r\nSince HEAD requests have no response body, responseText and responseData will be null.\r\n\r\niOS behavior is pretty easy to verify by adding a **undocumented onredirect callback** as shown below. Android actually has bug where it does not update the connectionType on the proxy for a redirected request. \r\n\r\n{code}\r\nonredirect : function(e) {\r\n Ti.API.debug(\"redirect location -> \" + this.location);\r\n Ti.API.debug(\"redirect connectionType-> \" + this.connectionType);\r\n Ti.API.debug(\"redirect status-> \" + this.status);\r\n //alert('Unable to play video.');\r\n },\r\n{code}\r\n", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-07-22T19:52:11.000+0000", "updated": "2014-07-22T19:52:11.000+0000" }, { "id": "416271", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-29T21:41:16.000+0000", "updated": "2017-03-29T21:41:16.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }