Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2580] 1.5.0: HTTP 302 response headers missing

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionDuplicate
Resolution Date2011-04-15T03:23:24.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.6.0 M05
ComponentsiOS
Labels1.5.0, httpclient, ios, release-1.6.0, response, xhr
Reportertom quas
AssigneeReggie Seagraves
Created2011-04-15T03:23:23.000+0000
Updated2017-03-03T05:45:41.000+0000

Description

My app talks to a backend service to upload images. After successful upload, the service responds with a 302, setting the Location: header to the URL of the image.

The app works with Ti 1.4.2. With 1.5.0, the Location: header is missing from the response.

Client code:
xhr.open('POST', url, false);
xhr.onload = function() {
location = xhr.getResponseHeader('Location');
after_upload_callback(location);
};

xhr.setRequestHeader('Content-Type', 'form-data');
xhr.setRequestHeader("Cache-Control", "no-cache");
xhr.send({ file:media });

Comments

  1. tom quas 2011-04-15

    After further investigation, I figured that the server returns a 200 response. The image upload works. Still, any response headers are missing with 1.5.0. FWIW, I attached the server code snippet.

    class UploadHandler(blobstore_handlers.BlobstoreUploadHandler):

       def get(self):
           pass
       
       def post(self):
           """ Stores a BLOB and returns its key."""
           blob_info = self.get_uploads()[0]
           asset_info = AssetInfo(blob=blob_info.key())
           asset_info.put()
           self.redirect('/serve/%s' % asset_info.key().id())   # invokes ServeHandler
       

    class ServeHandler(webapp.RequestHandler):

       def post(self, asset_id):
           self.response.headers['Pragma'] = 'no-cache'
           self.response.headers['Cache-Control'] = 'no-cache, no-store, must-revalidate, pre-check=0, post-check=0'
           url = "%s/asset/%s" % (self.request.host_url, asset_id)
           self.response.headers['Location'] = url
       
  2. tom quas 2011-04-15

    fixed w/ 1.5.1. thx.

  3. Stephen Tramer 2011-04-15

    Duplicate of other 1.5.x response header bugs.

  4. tom quas 2011-04-15

    duplicate of... which ticket? I still need to follow progress on this issue.

    thx, stephen

  5. Stephen Tramer 2011-04-15

    You yourself said that the issue was fixed in 1.5.1. This was part of the HTTPResponse refactor to allow access to underlying properties of the client. I'm unable to get a bug number because lighthouse sucks.

  6. tom quas 2011-04-15

    Ah, I misinterpreted this. Duplicate == closed. Thx

  7. Lee Morris 2017-03-03

    Closing issue due to time passed and irrelevance of the ticket.

JSON Source