此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in English Always switch to English

原因:expected 'true' in CORS header 'Access-Control-Allow-Credentials'

原因

原因:expected 'true' in CORS header 'Access-Control-Allow-Credentials'

哪里出错了?

CORS 请求要求服务器允许使用凭据,但是服务器的 Access-Control-Allow-Credentials 标头的值并没有设置为 true

想要在客户端解决此问题,请修改代码以不请求使用凭据:

想要通过更改服务器的配置来消除此错误,请调整服务器的配置以将 Access-Control-Allow-Credentials 标头的值设置为 true

参见