Results 1 to 5 of 5

Thread: [FIXED][3.x] Problem with XHR getReponseHeader

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext User
    Join Date
    Aug 2007
    Posts
    9
    Vote Rating
    0
      0  

    Exclamation [FIXED][3.x] Problem with XHR getReponseHeader

    Hi everyone,

    I found what I believe to be a bug in the method createResponseObject in the ext adapter. The problem code is:

    Code:
                    headerStr = o.conn.getAllResponseHeaders();                 
                    Ext.each(headerStr.split('\n'), function(v){ 
                        var t = v.split(':'); 
                        headerObj[t[0]] = t[1];  
                    });
    The problem that is happening is that when a header value contains a colon it does not get returned correctly. This is obviously occurring as a result of the split and following assignment. If the assignment line is changed to read:

    Code:
                    headerStr = o.conn.getAllResponseHeaders();                 
                    Ext.each(headerStr.split('\n'), function(v){ 
                        var t = v.split(':'); 
                        headerObj[t[0]] = t.slice(1,t.length).join(':');  
                    });
    it seems to work fine.

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,583
    Vote Rating
    873
      0  

    Default

    Out of interest/testing can you post the response headers you were using? Thanks.
    Evan Trimboli
    Twitter - @evantrimboli

  3. #3
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    119
      0  

    Default

    It's always possible that a header value contains a colon (first example that comes to mind is the redirect location url).

    I would suggest:
    Code:
    Ext.each(headerStr.split('\n'), function(v){
    	var t = v.indexOf(':');
    	headerObj[v.substr(0, t)] = v.substr(t + 1);
    });

  4. #4
    Ext User
    Join Date
    Aug 2007
    Posts
    9
    Vote Rating
    0
      0  

    Default

    Another example would be anything that contains date/time information (Date, Last-Modified, Expires, If-Modified-Since, etc)

  5. #5
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,583
    Vote Rating
    873
      0  

    Default

    Fixed in SVN.
    Evan Trimboli
    Twitter - @evantrimboli

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •