【发布时间】:2018-07-28 01:55:15
【问题描述】:
为了向服务器发送 cookie,我必须在 options 参数中使用 { withCredentials: true },但是当我使用时
this.http.get(this.accountUrl + 'ExternalLoginConfirmation', {
withCredentials: true })
我收到以下错误:
Response to preflight request doesn't pass access control check: 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'. Origin
'http://localhost:4202' is therefore not allowed access. The credentials
mode of requests initiated by the XMLHttpRequest is controlled by the
withCredentials attribute.
奇怪的是:当我通过浏览器调用此 url 时没有任何错误
你能帮帮我吗?
【问题讨论】:
标签: angular angular4-httpclient