The 'Access-Control-Allow-Origin' header contains multiple values '*, *', but only one is allowed

前端 未结 5 460
被撕碎了的回忆
被撕碎了的回忆 2021-02-02 08:49

I\'m using Angular and ASP.NET API. The issue I\'m facing: when I add CORS in the API code, it works on Internet Explorer but does not work on Chrome and Firefox.

Here i

5条回答
  •  春和景丽
    2021-02-02 09:22

    I had the same issue. After I put the exact domain instead of * (see below), it worked for me.

    var CorsAttribute = new EnableCorsAttribute("https://www.mywebsite.com","", ""); config.EnableCors(CorsAttribute);

提交回复
热议问题