1
0
mirror of https://github.com/bitwarden/server.git synced 2024-12-24 17:17:40 +01:00

simplified cors policy

This commit is contained in:
Kyle Spearrin 2017-12-04 21:44:02 -05:00
parent 02839f2046
commit eea119a4b6

View File

@ -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();