添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
The value of the 'Access-Control-Allow-Origin' header in the response must not.. 用户7814281138450 2022-11-10 17:13

The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.

当请求的凭据模式为include时,相应中的Access-Control-Allow-Origin标头的值不能是通配符 "*"

如在axios请求定义中设置withCredentials为true,则会在请求中传递cookie。
如果服务器返回任何set-cookie响应头, 那么必须返回Access-Control-Allow-Credentials: true, 否则将不会在客户端上创建 cookie ,导致此次错误 如果必须设置,需要后端指定确切的Access-Control-Allow-Origin响应头,

当请求中携带cookie时, Access-Control-Allow-Origin必须要有确切的指定, 不能是通配符( ),

  • 私信