ASP.NET 5/Core/vNext CORS not working even if allowing pretty much everything

后端 未结 9 1467
忘了有多久
忘了有多久 2020-12-10 12:24

I have a ASP.NET 5 Web API (Well, MVC now anyway) back-end which I am consuming in with the axios library in my JS app.

My CORS config in MVC is the following:

9条回答
  •  感情败类
    2020-12-10 12:30

    For me helps this:

    services.AddCors(options =>{
      options.AddPolicy(AllowAllCorsPolicy, builder =>{
        builder
        .SetIsOriginAllowed(x =>_ = true)
        .AllowAnyMethod()
        .AllowAnyHeader()
        .AllowCredentials();
      });
    });
    

    Taken from .

提交回复
热议问题