admin管理员组文章数量:1406942
Response to preflight request doesn't pass access control check.
XMLHttpRequest cannot load http://localhost:49531/Access/Authenticate. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:31775' is therefore not allowed access.
I am flushing request ing with OPTIONS
. Request returns with code 200, however I am still getting this error.
protected void Application_BeginRequest()
{
if (Request.Headers.AllKeys.Contains("Origin") && Request.HttpMethod == "OPTIONS")
{
Response.Flush();
Response.End();
}
}
What I am trying to do is to adding a token to header
from client side and server side. Once client has been authenticated, token is added to request from server. From next request initiated from client, this token is sent by javascript.
本文标签: javascriptCORS Response to preflight request doesn39t pass access control checkStack Overflow
版权声明:本文标题:javascript - CORS: Response to preflight request doesn't pass access control check - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744940492a2633453.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论