mirror of
https://github.com/bitwarden/server.git
synced 2025-04-15 10:08:14 -05:00
simplified cors policy
This commit is contained in:
parent
02839f2046
commit
eea119a4b6
@ -122,14 +122,6 @@ namespace Bit.Api
|
|||||||
services.AddBaseServices();
|
services.AddBaseServices();
|
||||||
services.AddDefaultServices(globalSettings);
|
services.AddDefaultServices(globalSettings);
|
||||||
|
|
||||||
// Cors
|
|
||||||
services.AddCors(config =>
|
|
||||||
{
|
|
||||||
config.AddPolicy("All", policy => policy
|
|
||||||
.AllowAnyHeader().AllowAnyMethod().AllowAnyOrigin().AllowCredentials()
|
|
||||||
.SetPreflightMaxAge(TimeSpan.FromDays(1)));
|
|
||||||
});
|
|
||||||
|
|
||||||
// MVC
|
// MVC
|
||||||
services.AddMvc(config =>
|
services.AddMvc(config =>
|
||||||
{
|
{
|
||||||
@ -197,7 +189,7 @@ namespace Bit.Api
|
|||||||
app.UseStaticFiles();
|
app.UseStaticFiles();
|
||||||
|
|
||||||
// Add Cors
|
// Add Cors
|
||||||
app.UseCors("All");
|
app.UseCors(policy => policy.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader().AllowCredentials());
|
||||||
|
|
||||||
// Add authentication to the request pipeline.
|
// Add authentication to the request pipeline.
|
||||||
app.UseAuthentication();
|
app.UseAuthentication();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user