{ "id": "139317", "key": "TIMOB-19162", "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": null, "resolutiondate": null, "created": "2014-11-10T11:18:08.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "3.4.0", "3.4.1", "TCSupportTriage", "exception", "httpclient", "iOS8", "url" ], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-02-28T19:55:32.000+0000", "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" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h2. Problem description\r\nWhen the httpclient request url starts with leading blanks, an exception is thrown when the \"send()\" function is executed.\r\n\r\n{noformat}\r\nmessage = \"-[NSNull rangeOfString:]: unrecognized selector sent to instance 0x3a804690\";\r\n{noformat}\r\n\r\nh2. Steps to reproduce\r\nCreate HTTPClient and use a request url with leading blanks: \" http://www.appcelerator.com\"\r\n\r\nh2. Test case\r\n{code:lang=javascript|title=app.js}\r\n(function() {\r\n\t\r\n\tvar urls = [\r\n\t\t\"http://www.appcelerator.com\",\r\n\t\t\"www.appcelerator.com\",\r\n\t\t\"appcelerator.com\",\r\n\t\t\"http://www.appcelerator2.com\",\r\n\t\t\"http2://www.appcelerator.com\",\r\n\t\t\"http:www.appcelerator.com\",\r\n\t\t\" http://www.appcelerator.com\" //exception\r\n\t];\t\r\n\tvar win = Ti.UI.createWindow({backgroundColor:'#ffffff'});\r\n\tvar view = Ti.UI.createView({layout:'vertical'});\r\n\tvar button = Ti.UI.createButton({title:' Run test ',top:100,borderRadius:5,borderColor:'#1C1C1C',backgroundColor:'#C0C0C0'});\r\n\tvar output = Ti.UI.createLabel({top: 20,font:{fontSize:11}});\r\n\t\r\n\tbutton.addEventListener('click',function(){\r\n\t\toutput.text = '';\r\n\t\tfor (var i=0; i < urls.length; i++) {\r\n\t\t sendGET(i,urls[i]);\r\n\t\t}\t\t\r\n\t});\r\n\t\r\n\tview.add(button);\r\n\tview.add(output);\r\n\twin.add(view);\r\n\t\r\n\tfunction sendGET(i,url){\r\n\t\t\r\n\t\tvar client = Ti.Network.createHTTPClient({\r\n\t\t onload : function(e) {\r\n\t\t \t var msg = 'Test ' + i + ': ' + url + ' - success';\r\n\t\t \t output.text += '\\n' + msg;\r\n\t\t Ti.API.log(msg);\r\n\t\t },\r\n\t\t onerror : function(e) {\r\n\t\t \tvar msg = 'Test ' + i + ': ' + url + ' - error';\r\n\t\t \toutput.text += '\\n' + msg;\r\n\t\t \tTi.API.error(msg);\r\n\t\t },\r\n\t\t});\r\n\t \tclient.open(\"GET\", url);\r\n\t \ttry{\r\n\t\t\tclient.send();\r\n\t\t}catch(e){\r\n\t \tvar msg = 'Test ' + i + ': ' + url + ' - EXCEPTION';\r\n\t \toutput.text += '\\n' + msg;\r\n\t \tTi.API.error(msg);\t\t\t\r\n\t\t}\t\t\r\n\t}\r\n\r\n\twin.open();\r\n})();\r\n{code}", "attachment": [], "flagged": false, "summary": "HTTPClient - request url with leading blanks cause an exception", "creator": { "name": "Esche", "key": "esche", "displayName": "Markus Eschenbach", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "Esche", "key": "esche", "displayName": "Markus Eschenbach", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Titanium SDK version: 3.4.0 GA & 3.4.1 GA\r\nPlatform & version: & iOS 8.1 & iOS 8.1.1\r\nDevice Details: Simulator and iPhone 5S\r\nHost Operating System: OS X 10.9 & OS X 10.10\r\nTitanium Studio version: 3.4.0.201409261227", "comment": { "comments": [], "maxResults": 2, "total": 2, "startAt": 0 } } }