如何跨域取到response额外的的headers
2021-01-08 本文已影响0人
小骆驼与秀秀
如何跨域取到 response 额外的的 headers
默认,跨域情况下,浏览器的 response 的 headers 只返回:
Cache-Control
Content-Language
Content-Type
Expires
Last-Modified
Pragma
如果要读取其他属性,需要在发送的请求头增加以下代码:
'Access-Control-Expose-Headers': ['Content-Disposition']
即可解决