diff --git a/src/Api/Startup.cs b/src/Api/Startup.cs index 5a6b15f35e..ae3e9bf87a 100644 --- a/src/Api/Startup.cs +++ b/src/Api/Startup.cs @@ -122,14 +122,6 @@ namespace Bit.Api services.AddBaseServices(); services.AddDefaultServices(globalSettings); - // Cors - services.AddCors(config => - { - config.AddPolicy("All", policy => policy - .AllowAnyHeader().AllowAnyMethod().AllowAnyOrigin().AllowCredentials() - .SetPreflightMaxAge(TimeSpan.FromDays(1))); - }); - // MVC services.AddMvc(config => { @@ -197,7 +189,7 @@ namespace Bit.Api app.UseStaticFiles(); // Add Cors - app.UseCors("All"); + app.UseCors(policy => policy.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader().AllowCredentials()); // Add authentication to the request pipeline. app.UseAuthentication();