1

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?

  • I realized that [Safari for Windows was supported till 2012](https://en.wikipedia.org/wiki/Safari_version_history). That's why resigned supporting it. – Kamil Zielinski Sep 09 '15 at 13:55

1 Answers1

0

I faced the same issue with Safari. As an alternative solution send data in response body instead of header.

Visit angularJS response header access returns null in Safari Browser

Community
  • 1
  • 1
Madhura KM
  • 140
  • 1
  • 10