Angular.js saying custom HTTP response header is null

前端 未结 1 1778
灰色年华
灰色年华 2021-01-18 00:04

The callback function for the POST is returning null for my custom HTTP header X-Auth-Token. Chrome is showing the correct POST response headers, but Angular.js

1条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-18 00:34

    Thanks for this solution goes to @dbugger who commented the answer I needed:

    Looks like the server needs to give permission to see the headers. Check out this: Reading response headers when using $http of Angularjs

    The proper way to make headers available outside of your local domain is to set: Access-Control-Expose-Headers on your webserver. In this particular case, you would put X-Auth-Token.

    0 讨论(0)
提交回复
热议问题