I think I've implemented CORS correctly. I added the .NET CORS package, and my ConfigureServices has this :
public void ConfigureServices(IServiceCollection services)
{
services.AddCors(); // Make sure you call this previous to AddMvc
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
}
And my Configure method has this :
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
app.UseMvc();
app.UseCors(
options => options.WithAnyOrigin().AllowAnyMethod()
);
}
But I can see in Chrome that it is not allowing any origin or sending CORS headers in return