MVC 5中的Access-Control-Allow-Origin

时间:2016-04-04 15:37:12

标签: angularjs asp.net-web-api

对预检请求的响应没有通过访问控制检查:否'访问控制 - 允许 - 来源'标头出现在请求的资源上。响应的HTTP状态代码为500。

1 个答案:

答案 0 :(得分:0)

In startup.auth.cs add the following code at the start of the ConfigureAuth method. You will need to install this Microsoft.Owin.Cors nuget package.

app.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll);