Modify ↓
Ticket #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: | ||
| Blocking: | Blocked by: |
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
comment:2 Changed 2 years ago by jaubourg
- Status changed from new to closed
- Resolution set to invalid
Like timmywil said: it's getAllResponseHeaders, not getAllRequestHeaders ;)
comment:3 Changed 2 years ago by hello@…
@ timmywil: Nope, see http://i.imgur.com/Eu8HY.png.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

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/