1
0
mirror of https://github.com/bitwarden/server.git synced 2025-03-16 14:13:10 +01:00

allow web vault origin for cors requests

This commit is contained in:
Kyle Spearrin 2019-07-25 15:05:03 -04:00
parent a0da6b3886
commit f6da38f931
3 changed files with 9 additions and 3 deletions

View File

@ -160,7 +160,9 @@ namespace Bit.Api
app.UseStaticFiles();
// Add Cors
app.UseCors(policy => policy.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader().AllowCredentials());
app.UseCors(policy => policy
.WithOrigins(globalSettings.BaseServiceUri.Vault)
.AllowAnyMethod().AllowAnyHeader().AllowCredentials());
// Add authentication to the request pipeline.
app.UseAuthentication();

View File

@ -94,7 +94,9 @@ namespace Bit.Events
app.UseDefaultMiddleware(env);
// Add Cors
app.UseCors(policy => policy.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader().AllowCredentials());
app.UseCors(policy => policy
.WithOrigins(globalSettings.BaseServiceUri.Vault)
.AllowAnyMethod().AllowAnyHeader().AllowCredentials());
// Add authentication to the request pipeline.
app.UseAuthentication();

View File

@ -94,7 +94,9 @@ namespace Bit.Notifications
}
// Add Cors
app.UseCors(policy => policy.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader().AllowCredentials());
app.UseCors(policy => policy
.WithOrigins(globalSettings.BaseServiceUri.Vault)
.AllowAnyMethod().AllowAnyHeader().AllowCredentials());
// Add authentication to the request pipeline.
app.UseAuthentication();