I'm sending a custom header from server in a response. In $http
response interceptor I want to get this header, but the only header I could get is Content-type
header. How can I resolve my problem?
Piece of my $http
interceptor:
response: function (response) {
var AuthToken = response.headers('AuthToken');
return response || $q.when(response);
},
AuthToken
is undefined.
$q.when(response)
, doesn't make any sense here – SquigglegetAllResponseHeaders()
bug in firefox. Tryconsole.log(response.headers())
to see the whole collection. BTW, is this a JSONP request on another domain? – KetchamObject {content-type: "text/html;charset=UTF-8"}
– OliveroAccess-Control-Allow-Headers
to instruct the browser that JavaScript from the other domain is allowed to read certain headers. – KetchamAuthToken
toAccess-Control-Allow-Headers
– Olivero