如何跨域取到response额外的的headers

146 阅读1分钟

参考链接

默认,跨域情况下,浏览器的 response 的 headers 只返回:

Cache-Control
Content-Language
Content-Type
Expires
Last-Modified
Pragma

如果要读取其他属性,需要在发送的请求头增加以下代码:

'Access-Control-Expose-Headers': ['Content-Disposition']

即可解决