{ "id": "62093", "key": "TIMOB-1461", "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": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T01:56:14.000+0000", "created": "2011-04-15T02:53:28.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [ "encoded", "encoding", "get", "httpclient", "ios", "method", "percent", "put", "url" ], "versions": [], "issuelinks": [], "assignee": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2011-04-17T01:56:14.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": "{html}

We upgraded to Titanium Mobile SDK from 1.3.0 to 1.4.0 and use\nthe same code base, but the effect differs.

\n

Trying to perform a HTTP request with PUT method fails and\nresults always in call of onerror and in a 404 errorcode.
\nDue to Wireshark analysis of HTTP request, we figured out that the\npath part of uri is url-encoded now.

\n

Requests towards uris like
\nhttp://www.ourdomain.com/our,comma,separated,path/
\nwill not work anymore in titanium mobile sdk 1.4.0

\n

Following code snippet works with 1.3.0 on iOS 3.1.3 and does\nnot work with 1.4.0 on iOS 4.0.1

\n
\n        var xhrPut = Titanium.Network.createHTTPClient();\n        xhrPut.onload = function()\n        {\n            if (this.status===204){\n                log(\"calling succes callback.\");\n            }else{\n                log(\"error loading \"+this.status+\" \"+this.responseData);\n            }\n        };\n        xhrPut.onerror = function()\n        {\n            log(\"error loading \"+this.status+\" \"+this.responseData);\n        };\n\n        xhrPut.open(\"PUT\",baseuri+uri);\n        xhrPut.setRequestHeader('Authorization','Basic '+authstrPut);\n        xhrPut.setRequestHeader('Content-Type', 'application/json; charset=utf-8');\n        xhrPut.setRequestHeader('Accept', 'application/json');\n        xhrPut.send(JSON.stringify(params));\n\n        //variables: baseuri, uri, authstrPut, params\n
\n

With regards.

{html}", "attachment": [], "flagged": false, "summary": "HTTP PUT method fails with SDK 1.4.0 due to url-encoded path", "creator": { "name": "martinlasak", "key": "martinlasak", "displayName": "Martin Lasak", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "martinlasak", "key": "martinlasak", "displayName": "Martin Lasak", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "125765", "author": { "name": "damienelmes", "key": "damienelmes", "displayName": "Damien Elmes", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

I believe this is fixed in the latest git already.

{html}", "updateAuthor": { "name": "damienelmes", "key": "damienelmes", "displayName": "Damien Elmes", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:53:29.000+0000", "updated": "2011-04-15T02:53:29.000+0000" }, { "id": "125766", "author": { "name": "hugojosefson", "key": "hugojosefson", "displayName": "Hugo Josefson", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

I have this problem too in Titanium SDK 1.4.0.

\n

For me, it's when I do a GET like this:

\n
\nvar url = 'http://www.ourdomain.com/page?Einstein=E%3Dmc2&paramWithSlashInIt=asd%2Fasd';\n
\n

When the xhr fetches that, it becomes:

\n
\nhttp://www.ourdomain.com/page?Einstein=E%253Dmc2&paramWithSlashInIt=asd%252Fasd\n
\n

...because the percent characters are encoded again. For us this\nmakes it impossible to do OAuth signed GET requests, which are\nvital for our application.

\n

I can confirm that nightly build from Aug 3 fixes the\nproblem.

\n

!! Please cut a 1.4.1 release soon :) !!

\n

Thanks for all your hard work.
\n/Hugo

{html}", "updateAuthor": { "name": "hugojosefson", "key": "hugojosefson", "displayName": "Hugo Josefson", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:53:29.000+0000", "updated": "2011-04-15T02:53:29.000+0000" }, { "id": "125767", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

I know that this is a duplicate of a bug that either Jeff or I\nhave fixed; we fiddled with URL encoding for a while. ','\ncharacters are no longer escaped. Checked 1.6.0RC1.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:53:30.000+0000", "updated": "2011-04-15T02:53:30.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }