Javascript safari的授权标头问题
Safari未向生产服务器上的服务器发送授权。这在Firefox、chrome和opera上非常有效Javascript safari的授权标头问题,javascript,ssl,safari,fetch-api,http-authentication,Javascript,Ssl,Safari,Fetch Api,Http Authentication,Safari未向生产服务器上的服务器发送授权。这在Firefox、chrome和opera上非常有效 fetch(url, { "Content-type": "application/json", Authorization: "Bearer sample_token" }).then(res => console.log(res)) .catch(err => console.log(err)); 你能找到解决方案吗?网上有很多
fetch(url, {
"Content-type": "application/json",
Authorization: "Bearer sample_token"
}).then(res => console.log(res))
.catch(err => console.log(err));
你能找到解决方案吗?网上有很多关于这个的讨论。Safari似乎对
授权
标题很挑剔。在某些情况下,Safari不允许更改标头,因为SSL证书是自签名的。在其他情况下,请求可能已被缓存。一些用户报告说,将标题名称从授权更改为其他名称可以解决问题,但这需要在前端和后端都进行,可能不是正确的解决方案。