Bug Tracker

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#8837 closed bug (invalid)

jqXHR.getAllResponseHeaders() returns only ‘Content-Type’

Reported by: hello@… Owned by:
Priority: undecided Milestone: 1.next
Component: ajax Version: 1.5.2
Keywords: Cc:
Blocked by: Blocking:

Description

Hi,

jqXHR.getAllResponseHeaders() returned only ‘Content-Type’ header, despite server had returned following headers.

Access-Control-Allow-Headers:Content-Type, X-DwA-Source, X-DwA-Signature, X-Requested-With
Access-Control-Allow-Methods:POST, GET, PUT, DELTE, OPTIONS
Access-Control-Allow-Origin:*
Connection:keep-alive
Content-Length:64
Content-Type:application/json;charset=utf-8
Server:thin 1.2.7 codename No Hup
X-DwA-Build:git_revize

jQuery version 1.5.2

Browser Google Chrome (12.0.725.0 dev)

OS Mac OS X (10.6.6)

jsFiddle http://jsfiddle.net/tp4jS/

Code

// onSuccess
var onSuccess = function(data, textStatus, jqXHR) {
    alert(jqXHR.getAllResponseHeaders());
};

// AJAX request
var request = {
    'url': 'http://api.drinkwithabraham.com/',
    'headers': {
        'X-DwA-Source': 'web',
        'Content-Type': 'application/json;charset=utf-8'  
    },
    'type': 'GET',
    'success': onSuccess
};

// Send
$.ajax(request);

Change History (4)

comment:1 Changed 5 years ago by timmywil

  • Component changed from unfiled to ajax

That looks like the only headers returned from the server: http://i.imgur.com/3A3xV.png See the ajax request in firebug: http://jsfiddle.net/timmywil/tp4jS/1/

comment:2 Changed 5 years ago by jaubourg

  • Resolution set to invalid
  • Status changed from new to closed

Like timmywil said: it's getAllResponseHeaders, not getAllRequestHeaders ;)

comment:3 Changed 5 years ago by hello@…

@ timmywil: Nope, see http://i.imgur.com/Eu8HY.png.

Note: See TracTickets for help on using tickets.