1

I am stuck in a problem where I am posting an object, in response I should get some header from the HTTP response. The problem is this code is working fine in browsers like Chrome, Firefox, IE but it returns null in case of Safari (Windows).

 $http.post(url, data)
         .then(function(response){
                console.log(response.headers("location"));
                // response.headers("location") is null in Safari
         });

Below are the response headers I am getting from the server.

Access-Control-Allow-Credentials:true
Access-Control-Allow-Origin:http://localhost:5000
Access-Control-Expose-Headers:ETag,Location
Content-Length:0
Date:Mon, 15 May 2017 12:46:14 GMT
Location: //my API
Server:Microsoft-IIS/8.5
X-Powered-By:ASP.NET
Ankit Singh
  • 121
  • 7

1 Answers1

0

Maybe your safari is an old version that works according to the old recommendations that every custom header must be prefixed with X- see this link: enter link description here

Ariel Braun
  • 86
  • 1
  • 8