It works in other browsers (Chrome, FF, IE) but I can't get all headers form the response in the Safari browser. I try to get X-Pagination-Total-Count
header returned by the server using this code.
$scope.logs = LogService.query( {id: data.id, 'per-page': 5, page: 1, sort: '-id'}, function(data, headers) {
console.log('headers',headers());
$scope.totalLogsNumber = headers('X-Pagination-Total-Count');
});
Console log shows that there is only one property in object returned by headers()
: content-type
.
I can see X-Pagination-Total-Count
header in the response in the developer tools.
I have set this header in the server's .htaccess
file
Header set Access-Control-Expose-Headers "X-Pagination-Total-Count, X-Pagination-Current-Page, X-Pagination-Page-Count, X-Pagination-Per-Page"
What's going on?