{ "id": "62615", "key": "TIMOB-1983", "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": [ { "id": "11225", "name": "Release 1.5.0", "archived": true, "released": true, "releaseDate": "2010-12-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T01:57:44.000+0000", "created": "2011-04-15T03:07:10.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "ios", "iphone", "regression" ], "versions": [], "issuelinks": [], "assignee": { "name": "rseagraves", "key": "rseagraves", "displayName": "Reggie Seagraves", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-04-17T01:57:44.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}

setRequest is broken on trunk for iPhone. Authorization header\nis not sent in request using latest nightly build r4c5cd4a3 (Oct\n1).

\n

var myUsername = 'testuser';
\nvar myPassword = 'testpass';

\n

var request = Titanium.Network.createHTTPClient({

\n
\n    onload:function(e) {\n        if (request.status != 200 && request.status != 201) {\n            request.onerror(e);\n            return;\n        }\n    },\n    onerror:function(e) {\n        Ti.API.info(\"Got Error: \"\n            + e.error);\n    }\n});\n
\n

request.open('GET', 'https://myserverurl', true);
\nrequest.setRequestHeader('Authorization','Basic ' +\nTitanium.Utils.base64encode(myUsername + ':' + myPassword));
\nrequest.send();

{html}", "attachment": [], "flagged": false, "summary": "setRequestHeader Broken for iPhone platform ", "creator": { "name": "fairwinds", "key": "fairwinds", "displayName": "David Pratt", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "fairwinds", "key": "fairwinds", "displayName": "David Pratt", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "127152", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Assigning to Ralf to triage. Ralf it looks like a regression so\nI've tagged it as such, it may not actually be.

{html}", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:07:11.000+0000", "updated": "2011-04-15T03:07:11.000+0000" }, { "id": "127153", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

This is odd given that the files in question haven't been\nchanged in any behavior-changing manner since before 1.4.0. The\nsetRequestHeader in that form is also used in KS's fourSquare demo,\nso we can recreate that way.

{html}", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:07:12.000+0000", "updated": "2011-04-15T03:07:12.000+0000" }, { "id": "127154", "author": { "name": "johnmcknight(atyahoo)", "key": "johnmcknight(atyahoo)", "displayName": "johnmcknight (at yahoo)", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

I don't think this is a bug. The open method expects that the\nrequestMethod has been defined before it has been called. In the\nexample, the open is done first and then the requestMethod is set\nand this can't work in the current implementation. If you swap the\norder it will work as expected. BTW - This also affects timeout in\nthat it must be defined before the open method is called. I have\nassumed this is more of a documentation issue than a bug.

{html}", "updateAuthor": { "name": "johnmcknight(atyahoo)", "key": "johnmcknight(atyahoo)", "displayName": "johnmcknight (at yahoo)", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:07:12.000+0000", "updated": "2011-04-15T03:07:12.000+0000" }, { "id": "127155", "author": { "name": "fairwinds", "key": "fairwinds", "displayName": "David Pratt", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Hi John. setRequestHeader was placed between the open and send\nas this was the only way it worked previously. Will confirm and\nreply back. Will be very satisfied if this simple change resolves\nthe issue as I am attempting to stick with nightly builds.

{html}", "updateAuthor": { "name": "fairwinds", "key": "fairwinds", "displayName": "David Pratt", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:07:13.000+0000", "updated": "2011-04-15T03:07:13.000+0000" }, { "id": "127156", "author": { "name": "fairwinds", "key": "fairwinds", "displayName": "David Pratt", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

I can confirm that changing order does NOT work with the Sep 8\nnightly build I reverted to as a result of this issue. I does work\nwith setRequestHeader following open but before send with this\nversion.

\n

I am obtaining latest nightly build today and will check if\nlastest build is in anyway different and report back.

{html}", "updateAuthor": { "name": "fairwinds", "key": "fairwinds", "displayName": "David Pratt", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:07:13.000+0000", "updated": "2011-04-15T03:07:13.000+0000" }, { "id": "127157", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Here is the specification entry for setRequestHeader\nnotice that it's an error for it to be called before it's in an\nOPEN state.

{html}", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:07:13.000+0000", "updated": "2011-04-15T03:07:13.000+0000" }, { "id": "127158", "author": { "name": "johnmcknight(atyahoo)", "key": "johnmcknight(atyahoo)", "displayName": "johnmcknight (at yahoo)", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

I am doing this with the build from last night and it is working\nfor me.

\n
\n  xhr.setRequestHeader(\"content-type\", \"multipart/form-data\");\n  xhr.open(\"POST\", service_url);\n  xhr.send(parms);\n
\n

BTW - I am running iOS SDK 3.2 and 4.1 and running Oct 7\nr3be604b2.

\n

Did you empty your iPhone build so it can force a new build with\nthe latest nightly?

{html}", "updateAuthor": { "name": "johnmcknight(atyahoo)", "key": "johnmcknight(atyahoo)", "displayName": "johnmcknight (at yahoo)", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:07:13.000+0000", "updated": "2011-04-15T03:07:13.000+0000" }, { "id": "127159", "author": { "name": "fairwinds", "key": "fairwinds", "displayName": "David Pratt", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Hi Don. Right.

\n

I am on SDK 4.1. John, will let you know shortly whether this\nworks with change of order. If it does, it is still a bug as it is\nmeant to be set following open.

{html}", "updateAuthor": { "name": "fairwinds", "key": "fairwinds", "displayName": "David Pratt", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:07:14.000+0000", "updated": "2011-04-15T03:07:14.000+0000" }, { "id": "127160", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Passing to Thom so he can test. Our KS->XHR->Cookies test\nuses request headers (in the specified manner, after open() is\ncalled) and works.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:07:14.000+0000", "updated": "2011-04-15T03:07:14.000+0000" }, { "id": "127161", "author": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

KS->XHR->Cookies ius failing in build 1.5.0.d58dbe. back\nto you Stephen.

{html}", "updateAuthor": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:07:14.000+0000", "updated": "2011-04-15T03:07:14.000+0000" }, { "id": "127162", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Test is passing for me off of the same build. Not sure what's\ngoing on here.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:07:15.000+0000", "updated": "2011-04-15T03:07:15.000+0000" }, { "id": "127163", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Okay, test has intermittent failures. Pass/fail may have\nsomething to do with the remote service and not with our XHR\nheader. We're going to need another way to test non-cookie headers,\nlooking into it.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:07:15.000+0000", "updated": "2011-04-15T03:07:15.000+0000" }, { "id": "127164", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Thom, gonna say that this one is fixed again now that I've found\na more reliable test, but with some (possible) caveats.

\n

The KS->Mashups->Foursquare test was always able to\nreliably produce a correct result for me. I would recommend you\ntest it before performing the following, which you may need to do\nif you keep getting geolocation errors from it:

\n\n

If you must do this, it appears to be an Apple bug that has to\ndo with geolocation fussiness in the transition from 3.1.x to 3.2,\ninternally. Not sure why.

\n

Second, I've opened up bug #2106,\nwhich indicates how certain module listeners may interact poorly\nwith themselves. 4SQ demonstrates this when used in conjunction\nwith any other geolocation requests on a different context - so\ndon't run the 4SQ test in the same session that you run\ngeolocation.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:07:15.000+0000", "updated": "2011-04-15T03:07:15.000+0000" }, { "id": "127165", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Reassigning back to me. Thom should catch it because it's\nfixed-in-qa anyway.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:07:15.000+0000", "updated": "2011-04-15T03:07:15.000+0000" }, { "id": "127166", "author": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

thanks for the info Stephen, closing against iPod 4th gen (4.1),\n3g 3.1.2 with mobile sdk build 1.5.0.62c1cae

{html}", "updateAuthor": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:07:15.000+0000", "updated": "2011-04-15T03:07:15.000+0000" }, { "id": "127167", "author": { "name": "fairwinds", "key": "fairwinds", "displayName": "David Pratt", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

I can authenticate using Basic Authorization with my app using\ncurl but returns 401 error with titanium most recent nightly\n1.4.2-r8e708e78. Were there commits to the code to change correct\nthis problem. Something is not right. The alternative to setting\nheaders is to embed username:password in url ie. https://user:pw@example.com which\nI had tried before but is also broken. See ticket #2149.\nPerhaps the original issue is related to #1502 which\nis unresolved.

{html}", "updateAuthor": { "name": "fairwinds", "key": "fairwinds", "displayName": "David Pratt", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:07:16.000+0000", "updated": "2011-04-15T03:07:16.000+0000" }, { "id": "127168", "author": { "name": "fairwinds", "key": "fairwinds", "displayName": "David Pratt", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Sorry. To be clear, I can authenticate against my api using curl\nusing name:pw in url or by setting headers. With Titanium app\ncannot get past 401 with headers set and cannot authenticate with\nuser:pw in url due to #2149.

{html}", "updateAuthor": { "name": "fairwinds", "key": "fairwinds", "displayName": "David Pratt", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:07:16.000+0000", "updated": "2011-04-15T03:07:16.000+0000" }, { "id": "127169", "author": { "name": "rpfeiffer", "key": "rpfeiffer", "displayName": "Ralf Pfeiffer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

to scrub

{html}", "updateAuthor": { "name": "rpfeiffer", "key": "rpfeiffer", "displayName": "Ralf Pfeiffer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:07:16.000+0000", "updated": "2011-04-15T03:07:16.000+0000" }, { "id": "127170", "author": { "name": "rpfeiffer", "key": "rpfeiffer", "displayName": "Ralf Pfeiffer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Our testing shows this to be working properly.

\n

If there is an issue, it is likely with 2149, which we are\ninvestigating.

{html}", "updateAuthor": { "name": "rpfeiffer", "key": "rpfeiffer", "displayName": "Ralf Pfeiffer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:07:16.000+0000", "updated": "2011-04-15T03:07:16.000+0000" }, { "id": "127171", "author": { "name": "fairwinds", "key": "fairwinds", "displayName": "David Pratt", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Hi Stephen. There is something here that is not getting picked\nup with whatever you are doing for testing. The httpclient does not\nconsistently work. In fact, I can demonstrate authentication\nfailure where curl succeeds always with same credentials (with\nheaders set or user:pw in url where titanium fails on both counts.\nI am prepared to create a small app to demonstrate.

{html}", "updateAuthor": { "name": "fairwinds", "key": "fairwinds", "displayName": "David Pratt", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:07:17.000+0000", "updated": "2011-04-15T03:07:17.000+0000" }, { "id": "127172", "author": { "name": "fairwinds", "key": "fairwinds", "displayName": "David Pratt", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Have not had a reply to above. The client is not reliable.\nPlease advise whether you are willing to look at code that will\ndemonstrate failure and I will bundle a small app to send along\nwith instructions to demonstrate failure. Will need some detail for\nsending as will not post here. Am going to attempt wrapping another\nlib as a module in the interim. Am frustrated by the problems and\nthe block to development on iOS.

{html}", "updateAuthor": { "name": "fairwinds", "key": "fairwinds", "displayName": "David Pratt", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:07:17.000+0000", "updated": "2011-04-15T03:07:17.000+0000" }, { "id": "127173", "author": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

fairwinds - if you could post the file to drop.io and send me\n(thuelbert@appcelerator.com)\nan email, I'll make sure the file gets to Stephen. Thanks.

{html}", "updateAuthor": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:07:17.000+0000", "updated": "2011-04-15T03:07:17.000+0000" }, { "id": "127174", "author": { "name": "fairwinds", "key": "fairwinds", "displayName": "David Pratt", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Thomas. drop.io has been bought so will be unable to post there.\nWill simply send app.js content with some instructions as soon as I\nhave them written up. I would expect this later today or tomorrow.\nYou will see by the small example bad things have become with a\nsmall piece of code that does nothing but fetch json using the\nclient. Parse, authentication failure, headers being ignored, and\ninability to get content as needed from the client. This will be\ncontrasted by simple curl fetches that succeed in all cases.

{html}", "updateAuthor": { "name": "fairwinds", "key": "fairwinds", "displayName": "David Pratt", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:07:17.000+0000", "updated": "2011-04-15T03:07:17.000+0000" }, { "id": "127175", "author": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

fairwinds - d'oh, that's right. I'll look for your email.

{html}", "updateAuthor": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:07:17.000+0000", "updated": "2011-04-15T03:07:17.000+0000" }, { "id": "127176", "author": { "name": "anthonywebb", "key": "anthonywebb", "displayName": "Anthony Webb", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

I think this should be opened back up. I am still having the\nissue where headers cant be set properly. I am using the latest\ncont build from Dec 23 (Dec 23 2010 14:19 readb8ad1) and tested on\nthe emulator and iphone device (4.2) No matter what I try I can\nnever override the content-type, it always is:\napplication/x-www-form-urlencoded;

\n

Consider the following code:
\nvar xhr = Titanium.Network.createHTTPClient();
\nxhr.onload = function()
\n{

\n
\nTi.API.info('I am in utf-8 onload for POST');\n
\n

}; xhr.onerror = function()
\n{

\n
\nTi.API.info('I am in utf-8 error for POST');\n
\n

}; xhr.setRequestHeader(\"setoutside\", \"one\");
\nxhr.open(\"POST\",\"http://api.localmedia.fm/files/endpoint_webform.cfm\");
\nxhr.setRequestHeader(\"content-type\", \"multipart/form-data\");
\nxhr.setRequestHeader(\"setinside\", \"two\");
\nxhr.send({\"a\":\"hi\", \"b\":\"there\"});

\n

When this hits my server I have the following headers:

\n

Accept-Encoding gzip
\nConnection keep-alive
\nContent-Length 12
\nContent-Type application/x-www-form-urlencoded; charset=utf-8
\nCookie CFID=3538862; CFTOKEN=38108057
\nHost api.localmedia.fm
\nSetinside two
\nUser-Agent Appcelerator Titanium/cont-1.6.0 (iPhone Simulator/4.2;\niPhone OS; en_US;)
\nX-Requested-With XMLHttpRequest

{html}", "updateAuthor": { "name": "anthonywebb", "key": "anthonywebb", "displayName": "Anthony Webb", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:07:18.000+0000", "updated": "2011-04-15T03:07:18.000+0000" }, { "id": "127177", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Please follow bug #2675. We are in the process of revising our XHR\nsupport and this issue will be taken care of as part of it.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:07:18.000+0000", "updated": "2011-04-15T03:07:18.000+0000" }, { "id": "127178", "author": { "name": "anthonywebb", "key": "anthonywebb", "displayName": "Anthony Webb", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Thanks Stephen, I've remove photo support from my app as I cant\npost stuff to the server without using multipart/form-data, here's\nhoping it is fixed soon, I will watch 2675. It is worth nothing\nthough that adding the interface bits to my app was a breeze with\nappcelerator :)

{html}", "updateAuthor": { "name": "anthonywebb", "key": "anthonywebb", "displayName": "Anthony Webb", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:07:18.000+0000", "updated": "2011-04-15T03:07:18.000+0000" } ], "maxResults": 27, "total": 27, "startAt": 0 } } }