{ "id": "63212", "key": "TIMOB-2580", "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": "11238", "name": "Release 1.6.0 M05", "archived": true, "released": true, "releaseDate": "2011-01-17" } ], "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2011-04-15T03:23:24.000+0000", "created": "2011-04-15T03:23:23.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "1.5.0", "httpclient", "ios", "release-1.6.0", "response", "xhr" ], "versions": [], "issuelinks": [], "assignee": { "name": "rseagraves", "key": "rseagraves", "displayName": "Reggie Seagraves", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-03T05:45:41.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}
My app talks to a backend service to upload images. After\nsuccessful upload, the service responds with a 302, setting the\nLocation: header to the URL of the image.
\nThe app works with Ti 1.4.2. With 1.5.0, the Location: header is\nmissing from the response.
\nClient code:
\nxhr.open('POST', url, false);
\nxhr.onload = function() {
\nlocation = xhr.getResponseHeader('Location');
\nafter_upload_callback(location);
\n};
xhr.setRequestHeader('Content-Type', 'form-data');
\nxhr.setRequestHeader(\"Cache-Control\", \"no-cache\");
\nxhr.send({ file:media });
After further investigation, I figured that the server returns a\n200 response. The image upload works. Still, any response headers\nare missing with 1.5.0. FWIW, I attached the server code\nsnippet.
\nclass\nUploadHandler(blobstore_handlers.BlobstoreUploadHandler):
\ndef get(self):\n pass\n\ndef post(self):\n \"\"\" Stores a BLOB and returns its key.\"\"\"\n blob_info = self.get_uploads()[0]\n asset_info = AssetInfo(blob=blob_info.key())\n asset_info.put()\n self.redirect('/serve/%s' % asset_info.key().id()) # invokes ServeHandler
\n
\nclass ServeHandler(webapp.RequestHandler):
\ndef post(self, asset_id):\n self.response.headers['Pragma'] = 'no-cache'\n self.response.headers['Cache-Control'] = 'no-cache, no-store, must-revalidate, pre-check=0, post-check=0'\n url = \"%s/asset/%s\" % (self.request.host_url, asset_id)\n self.response.headers['Location'] = url
\n
fixed w/ 1.5.1. thx.
Duplicate of other 1.5.x response header bugs.
duplicate of... which ticket? I still need to follow progress on\nthis issue.
\nthx, stephen
You yourself said that the issue was fixed in 1.5.1. This was\npart of the HTTPResponse refactor to allow access to underlying\nproperties of the client. I'm unable to get a bug number because\nlighthouse sucks.
Ah, I misinterpreted this. Duplicate == closed. Thx