{ "id": "86899", "key": "TIMOB-8376", "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": "10100", "description": "This issue won't be actioned.", "name": "Won't Do" }, "resolutiondate": "2020-01-10T18:02:29.000+0000", "created": "2012-02-23T14:40:54.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "parity" ], "versions": [ { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" }, { "id": "12677", "description": "Release 1.8 Service Pack 1", "name": "Release 1.8.1", "archived": true, "released": true, "releaseDate": "2012-01-31" }, { "id": "13070", "description": "Release 1.8 Service Pack 2", "name": "Release 1.8.2", "archived": true, "released": true, "releaseDate": "2012-02-29" }, { "id": "13272", "description": "Release 2.0.1", "name": "Release 2.0.1", "archived": true, "released": true, "releaseDate": "2012-04-16" } ], "issuelinks": [], "assignee": null, "updated": "2020-01-10T18:02:29.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": "h4. Problem Description \r\nWhen following the location header of a 302 FOUND redirect, an already URL encoded URL is then encoded again (for example the value %3D becomes %253D as the percent sign is URL encoded). This does not happen on 1.7.5 SDK, only 1.8.0.1 and 1.8.1\r\n\r\nh4. Actual Results\r\nthe URL being reencoded \r\n\r\nh4. Expected REsults\r\nif the URL is encoded, don't reencode. \r\n\r\nh4. Test Case \r\n*Example*\r\n1. xhr request is made to http://www.dropbox.com/u/18787705/app%3Dlogo.jpeg\r\n2. Response is 302 FOUND with location header of http://dl-web.dropbox.com/u/18787705/app%3Dlogo.jpeg\r\n3. Under 1.8 SDK a request is then made to http://dl-web.dropbox.com/u/18787705/app%253Dlogo.jpeg (note how the % is encoded to %25)\r\n4. A 404 is returned as this evaluates to a filename of \"app%3Dlogo.jpeg\" instead of \"app=logo.jpeg\" as expected\r\n\r\nThe sample code below shows that this is a problem both with HTTPClient object as well as the remote image property of imageviews (toggle the makeXhrRequest variable to try both ways). The following successfully returns an image both ways under 1.7.5 SDK\r\n\r\n{code:title=app.js|borderStyle=solid}\r\nvar makeXhrRequest = false;\r\n\r\nvar win = Titanium.UI.createWindow();\r\nvar img = Ti.UI.createImageView();\r\n\r\nif(makeXhrRequest){\r\n\tvar xhr = Titanium.Network.createHTTPClient();\r\n\r\n\txhr.onload = function() {\r\n\t\timg.image = this.responseData;\r\n\t};\r\n \txhr.open(\"GET\", 'http://www.dropbox.com/u/18787705/app%3Dlogo.jpeg');\r\n \txhr.send();\r\n \t\r\n} else {\r\n\timg.image = 'http://www.dropbox.com/u/18787705/app%3Dlogo.jpeg';\r\n}\r\n\r\nwin.add(img);\r\nwin.open();\r\n{code} \r\n\r\n", "attachment": [], "flagged": false, "summary": "iOS: Improper URL reencoding on 302 FOUND redirect for 1.8/2.0 SDK", "creator": { "name": "trentw", "key": "trentw", "displayName": "Trent Walkiewicz", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "trentw", "key": "trentw", "displayName": "Trent Walkiewicz", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "iOS 5.0 and Ti SDK 1.8.0.1 / 1.8.1", "comment": { "comments": [ { "id": "184781", "author": { "name": "trentw", "key": "trentw", "displayName": "Trent Walkiewicz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Just tested in 1.8.2 SDK and the problem persists. This problem is forcing me to stick to 1.7.5", "updateAuthor": { "name": "trentw", "key": "trentw", "displayName": "Trent Walkiewicz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-01T11:03:28.000+0000", "updated": "2012-03-01T11:03:28.000+0000" }, { "id": "195535", "author": { "name": "jyounus", "key": "jyounus", "displayName": "Junaid Younus", "active": true, "timeZone": "Europe/London" }, "body": "Tested with 2.0.1GA2 on the iOS simulator, issue still exists. Seems to work fine on Android.", "updateAuthor": { "name": "jyounus", "key": "jyounus", "displayName": "Junaid Younus", "active": true, "timeZone": "Europe/London" }, "created": "2012-05-21T15:42:15.000+0000", "updated": "2012-05-21T15:42:15.000+0000" }, { "id": "222659", "author": { "name": "roelandp2", "key": "roelandp2", "displayName": "roeland", "active": true, "timeZone": "Europe/Berlin" }, "body": "Tested with 2.1.2GA and problem still exists both in iOS simulator and Device. For me however it used to work also in versions up to 1.8.2 but during that period I used a rather low iOS SDK instead: 4.3. \r\n\r\n\r\nNow with a brandnew computer, 2.1.2GA and iOS SDK 6.0 I also face this problem/bug. \r\n\r\n\r\nMy workaround is by rawurlencoding the 'URL to 302 to' serverside before the actual header: 'Location' is returned to the xhr/client. But I think that's suboptimal.\r\n\r\n\r\nMore comments at https://developer.appcelerator.com/question/132556/improper-url-encoding-for-302-found-on-18", "updateAuthor": { "name": "roelandp2", "key": "roelandp2", "displayName": "roeland", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-10-08T23:57:03.000+0000", "updated": "2012-10-09T00:01:41.000+0000" }, { "id": "222662", "author": { "name": "roelandp2", "key": "roelandp2", "displayName": "roeland", "active": true, "timeZone": "Europe/Berlin" }, "body": "*", "updateAuthor": { "name": "roelandp2", "key": "roelandp2", "displayName": "roeland", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-10-08T23:58:58.000+0000", "updated": "2012-10-09T00:01:09.000+0000" }, { "id": "453641", "author": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This issue is out of date with our current supported SDK release (7.5.2.GA as of the date of closure), and out of date with mobile OS versions. \r\n\r\nIf community members feel that the issue is still valid, please create a new ticket. Please reference this closed ticket number, include SDK used, comments, and code that demonstrates/reproduces the issue.", "updateAuthor": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-01-10T18:02:29.000+0000", "updated": "2020-01-10T18:02:29.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }