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

后端 未结 9 1466
忘了有多久
忘了有多久 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:46

    You have to add Cors before MVC. The registration order of the middleware is important. If Cors is registered after mvc it will never be called. They are called in the order of registration.

    Once cors process the request, it will pass it to next middleware (Mvc)

提交回复
热议问题