mirror of
https://github.com/bitwarden/server
synced 2025-12-18 09:13:19 +00:00
differentially inject playId middleware
This commit is contained in:
@@ -659,7 +659,10 @@ public static class ServiceCollectionExtensions
|
|||||||
IWebHostEnvironment env, GlobalSettings globalSettings)
|
IWebHostEnvironment env, GlobalSettings globalSettings)
|
||||||
{
|
{
|
||||||
app.UseMiddleware<RequestLoggingMiddleware>();
|
app.UseMiddleware<RequestLoggingMiddleware>();
|
||||||
app.UseMiddleware<PlayIdMiddleware>();
|
if (globalSettings.TestPlayIdTrackingEnabled)
|
||||||
|
{
|
||||||
|
app.UseMiddleware<PlayIdMiddleware>();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void UseForwardedHeaders(this IApplicationBuilder app, IGlobalSettings globalSettings)
|
public static void UseForwardedHeaders(this IApplicationBuilder app, IGlobalSettings globalSettings)
|
||||||
|
|||||||
@@ -29,7 +29,10 @@ builder.Services.AddQueries();
|
|||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
||||||
// Add PlayIdMiddleware services
|
// Add PlayIdMiddleware services
|
||||||
app.UseMiddleware<PlayIdMiddleware>();
|
if (globalSettings.TestPlayIdTrackingEnabled)
|
||||||
|
{
|
||||||
|
app.UseMiddleware<PlayIdMiddleware>();
|
||||||
|
}
|
||||||
|
|
||||||
// Configure the HTTP request pipeline.
|
// Configure the HTTP request pipeline.
|
||||||
if (!app.Environment.IsDevelopment())
|
if (!app.Environment.IsDevelopment())
|
||||||
@@ -39,8 +42,6 @@ if (!app.Environment.IsDevelopment())
|
|||||||
|
|
||||||
app.UseRouting();
|
app.UseRouting();
|
||||||
|
|
||||||
app.MapControllerRoute(name: "default", pattern: "{controller=Seed}/{action=Index}/{id?}");
|
|
||||||
|
|
||||||
app.Run();
|
app.Run();
|
||||||
|
|
||||||
// Make Program class accessible for integration tests
|
// Make Program class accessible for integration tests
|
||||||
|
|||||||
Reference in New Issue
Block a user