How to fix “The CORS protocol does not allow specifying a wildcard (any) origin and credentials at the same time” error

后端 未结 7 970
再見小時候
再見小時候 2021-02-03 17:10

I\'ve already enabled CORS on the project in C# .net Core

In startup.cs I\'ve added lines

...
services.AddCors();
...
app.UseCors(builder =         


        
7条回答
  •  旧巷少年郎
    2021-02-03 17:38

    I had the same issue, the problem was solved by removing slash( / ) from the ending of URL, because I always copy and paste urls from chrome browser and it has the / at the end :

      .WithOrigins("https://localhost:60576/")  // not working 
    

    but

      .WithOrigins("https://localhost:60576")  // working  !!!
    
        
    

提交回复
热议问题