I made some ajax GET call ($http.get
) where server returns custom header in response. When I look into network the custom header (x-filename) is there, but when I try to access it via response.header()
it's not there. Do you have any idea why my custom header is not in headers object?
Asked
Active
Viewed 29 times
0

Sławomir Rosiek
- 4,038
- 3
- 25
- 43
-
Possibly, you are recieving a filtered response through the HTTP interceptor. Did you console the response object. What does it look like? – Saurabh Tiwari Sep 10 '18 at 11:21
-
It looks like these header is not returned by `getAllAllResponseHeaders()` – Sławomir Rosiek Sep 10 '18 at 11:47
-
The reason why it didn't work was lack of `Access-Control-Expose-Headers` in CORS configuration – Sławomir Rosiek Sep 11 '18 at 07:08