{ "id": "63727", "key": "TIMOB-3095", "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": "11242", "name": "Release 1.6.0 M09", "archived": true, "released": true, "releaseDate": "2011-02-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T02:00:54.000+0000", "created": "2011-04-15T03:36:46.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [ "android", "defect", "release-1.6.0", "reported-1.6.0" ], "versions": [], "issuelinks": [], "assignee": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-04-17T02:00:54.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "{html}

For example, we check for \"Cache-Control\" and would miss\n\"cache-control\". According to this\nheaders are case-insensitive.

\n

Failcase app.js:

\n
\n\nTitanium.UI.setBackgroundColor('#000');\nvar win = Titanium.UI.createWindow({  \n    title:'Test',\n    backgroundColor:'#000',\n    exitOnClose: true\n});\nvar thisURL = \"module=MultiSites&action=getEvolutionGraph&period=day&date=2011-01-04,2011-02-02&evolutionBy=visits&columns=nb_visits&idSite=7&idsite=7&viewDataTable=sparkline\";\n\nvar paramArray = thisURL.split(\"&\");\nfor(var i=0,ilen=paramArray.length;i<ilen;i++){\n    var thisKeyValue = paramArray[i].split(\"=\");\n    thisKeyValue[1] = Ti.Network.encodeURIComponent(thisKeyValue[1]);\n    paramArray[i] = thisKeyValue.join(\"=\");\n}\nvar encodedURI = paramArray.join(\"&\");\nvar encodedURL = \"http://demo.piwik.org/index.php?\" + encodedURI;\nTi.API.info(encodedURL);\n\nvar imageView = Ti.UI.createImageView({\n    image: encodedURL\n});\n \nwin.add(imageView);\nwin.open();\n
\n

Follow these steps:

\n\n
\nadb shell\ncd /sdcard/[your app id]/remote-image-cache\nls\ncat *.hdr\n
\n

(But of course replace [your app id] with your app's id.)

\n

After entering the ls command, you will see files\nlisted. There should not be any, because the file that is being\ncached there should not have been cached. You can see that because\nof the cat command which shows you the http headers\nretrieved upon getting the remote file. One of the headers is\ncache-control and it indicates that the file should\nnot be cached. But it was, and the reason is\nbecause we were looking for Cache-Control in a\ncase-sensitive fashion, so we missed\ncache-control.

\n

Important notes re testing the fix

\n

Once you're ready to test the fix, you need to be sure to\nclear the cache to get rid of those files that\nshouldn't have been there in the first place.

\n
\nadb shell\ncd /sdcard\nrm -r [your app id]\n
\n

And when you test the fix, don't be shocked if no image at all\nappears on screen. That's bug #3093. For\nthis test, you just want to be sure that after you launch the app\nthere is nothing in the remote-image-cache for your app.

{html}", "attachment": [], "flagged": false, "summary": "Android: Our download cache does not respect the standard of case-insensitive headers", "creator": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "130046", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

(from [4f7ca257dc0c13829996d2c6503cce5effff8388])\nAccess headers in case-insensitive fashion, do not write out\ntransfer-encoding: chunked header, fix regular expression that\nchecks for no caching, fix removal of uri from set of uris\ncurrently downloading. [#3095 state:fixed-in-qa][#3094\nstate:fixed-in-qa] \nhttps://github.com/appcelerator/titanium_mobile/commit/4f7ca257dc0c...

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:36:47.000+0000", "updated": "2011-04-15T03:36:47.000+0000" }, { "id": "130047", "author": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "body": "{html}

verified emulator 2.2

{html}", "updateAuthor": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "created": "2011-04-15T03:36:48.000+0000", "updated": "2011-04-15T03:36:48.000+0000" }, { "id": "130048", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

(from [d08271606cb059c5bc0d3be4a0ec809ba990fe29])\nAccess headers in case-insensitive fashion, do not write out\ntransfer-encoding: chunked header, fix regular expression that\nchecks for no caching, fix removal of uri from set of uris\ncurrently downloading. [#3095 state:fixed-in-qa][#3094\nstate:fixed-in-qa] \nhttps://github.com/appcelerator/titanium_mobile/commit/d08271606cb0...

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:36:48.000+0000", "updated": "2011-04-15T03:36:48.000+0000" }, { "id": "130049", "author": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "body": "{html}

Setting back to resolved. Was set to fixed-in-qa by cherry\npick.

{html}", "updateAuthor": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "created": "2011-04-15T03:36:48.000+0000", "updated": "2011-04-15T03:36:48.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }