diff --git a/src/SharedWeb/Utilities/ServiceCollectionExtensions.cs b/src/SharedWeb/Utilities/ServiceCollectionExtensions.cs index 720477f073..3776de5952 100644 --- a/src/SharedWeb/Utilities/ServiceCollectionExtensions.cs +++ b/src/SharedWeb/Utilities/ServiceCollectionExtensions.cs @@ -659,7 +659,10 @@ public static class ServiceCollectionExtensions IWebHostEnvironment env, GlobalSettings globalSettings) { app.UseMiddleware(); - app.UseMiddleware(); + if (globalSettings.TestPlayIdTrackingEnabled) + { + app.UseMiddleware(); + } } public static void UseForwardedHeaders(this IApplicationBuilder app, IGlobalSettings globalSettings) diff --git a/util/SeederApi/Program.cs b/util/SeederApi/Program.cs index f88c17b5db..7781dd8dbb 100644 --- a/util/SeederApi/Program.cs +++ b/util/SeederApi/Program.cs @@ -29,7 +29,10 @@ builder.Services.AddQueries(); var app = builder.Build(); // Add PlayIdMiddleware services -app.UseMiddleware(); +if (globalSettings.TestPlayIdTrackingEnabled) +{ + app.UseMiddleware(); +} // Configure the HTTP request pipeline. if (!app.Environment.IsDevelopment()) @@ -39,8 +42,6 @@ if (!app.Environment.IsDevelopment()) app.UseRouting(); -app.MapControllerRoute(name: "default", pattern: "{controller=Seed}/{action=Index}/{id?}"); - app.Run(); // Make Program class accessible for integration tests