{ "id": "147427", "key": "AC-1358", "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": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2015-09-30T02:25:44.000+0000", "created": "2015-04-30T18:09:42.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:37:46.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "Problem \r\nThe WebView component called [setBasicAuthentication|http://docs.appcelerator.com/titanium/3.0/#!/api/Titanium.UI.WebView-method-setBasicAuthentication]. This attempts to set the Authorization header on any requests initialized by setting the url property.\r\n\r\nDepending on the length of the username and password, the resulting base64-encoded value may have line breaks. Line breaks are not allowed in HTTP headers so everything following is truncated, of course causing authentication to fail. The line breaks need to be removed before setting to the Authorization header.\r\n\r\nI assume this is also an issue on the HTTP Client on iOS, but I haven't checked.\r\n\r\nTest case \r\n1. Use setBasicAuthentication to set a username and password for a WebView request; set the username and password to something longer than 30 characters each.\r\n2. Set a breakpoint at about line 184 in TiUIWebView.m and inspect the value of basicCredentials before it is set to the Authorization header.\r\n3. The value should have no line breaks to ensure the entire value is received by the server. But, if the username/password combination was long enough, it will have line breaks.", "attachment": [], "flagged": false, "summary": "iOS: TiUIWebview - Base64-encoded credentials contain linebreaks", "creator": { "name": "dpfeiffer", "key": "dpfeiffer", "displayName": "Daniel Pfeiffer", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "dpfeiffer", "key": "dpfeiffer", "displayName": "Daniel Pfeiffer", "active": true, "timeZone": "America/Chicago" }, "environment": "Titanium SDK version: 3.5.1.GA\r\nPlatform & version: iOS 8.2, iOS 7.1\r\nDevice Details: iOS simulator\r\nHost Operating System: OS X 10.10\r\nTitanium Studio version: 3.4.1.201410281727", "comment": { "comments": [ { "id": "362426", "author": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "body": " Hello,\r\n\r\nTested your issue. We could not reproduce it.\r\n\r\n*Test Environments:*\r\n\r\nCLI Version :4.0.1\r\nTitanium SDK Version:4.1.0.GA\r\nAndroid: Google Galaxy Nexus:4.1.1 - API 16 - 720x1280\r\nAppc Studio: Appcelerator Studio, build: 4.1.1.201507141126\r\nAlloy: 1.7.6\r\nAndroid Device: Nexus 7\r\niOS SDK: 8.1\r\n\r\n\r\n*Steps to Reproduce:*\r\n\r\n* Create a classic project.\r\n* Paste sample code.\r\n* Run the project\r\n\r\n*Test code:*\r\napp.js\r\n{code}\r\n\r\n\r\n//\r\n\r\n// create base UI tab and root window\r\n\r\n//\r\n\r\nvar win1 = Titanium.UI.createWindow({ \r\n\r\n title:'Tab 1',\r\n\r\n backgroundColor:'#fff'\r\n\r\n});\r\n\r\n\r\n\r\n\r\n\r\nusername='sccscssgdasadsvsdvasdcartrt';\r\n\r\npassword='ertededqwtedtqdwetdqewdqtwedqtdetqdwetqdwed';\r\n\r\nauthstr = Titanium.Utils.base64encode(username.value + ':' + password.value);\r\n\r\nTi.API.info('encode is'+authstr);\r\n\r\nvar webView = Ti.UI.createWebView();\r\n\r\nwebView.setBasicAuthentication(username,password);\r\n\r\nwebView.url = 'http://juktashor.com/';\r\n\r\n\r\n\r\nwin1.open();\r\n\r\n{code}\r\n\r\n*Test Result:*\r\n\r\n\r\nNo lines break found using using base64-encode.\r\n\r\n*Simulator Console logs:*\r\n\r\n{code}\r\n\r\nApplication started\r\n[INFO] : TC4766Classic/1.0 (4.1.0.d57aa7d)\r\n[INFO] : encode isdW5kZWZpbmVkOnVuZGVmaW5lZA==\r\n\r\n{code}", "updateAuthor": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-09-07T09:03:34.000+0000", "updated": "2015-09-30T02:25:37.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }