Only a specific list of "safe" headers is provided by default (for Javascript). This is for security reasons. This list is as follows
- Cache control
- Content language
- content type
- Expires
- Last change
- Pragma
To set other headers, the server must send an Access-Control-Expose-Headers
control header, listing all the headers that it wants to provide.
Access-Control-Expose-Headers: Content-Length, X-CSRF-Token
source share