From eea119a4b6b1a339300b97a1a7406590ba0ad599 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 4 Dec 2017 21:44:02 -0500 Subject: [PATCH] simplified cors policy --- src/Api/Startup.cs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) 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();