ASP.NET Core SignalR CORS 跨域问题

引用: https://www.cnblogs.com/IT-Ramon/p/12156832.html

 

Startup类:

 ConfigureServices方法添加:

   services.AddCors(op => { op.AddPolicy(“cors”, set => { set.SetIsOriginAllowed(origin => true).AllowAnyHeader().AllowAnyMethod().AllowCredentials(); }); });

Configure:方法添加Cors:

      app.UseCors(“cors”);

 

posted @ 2020-08-21 15:46  一切平常心  阅读(324)  评论(0编辑  收藏  举报