services.AddCors(options => { options.AddPolicy("abc", builder => { //App:CorsOrigins in appsettings.json can contain more than one address with splitted by comma. builder .SetIsOriginAllowed(_ => true) .AllowAnyHeader() .AllowAnyMethod() .AllowCredentials(); }); });
app.UseCors("abc");