diff --git a/Huxley2/Startup.cs b/Huxley2/Startup.cs index cdd4c66..f108939 100644 --- a/Huxley2/Startup.cs +++ b/Huxley2/Startup.cs @@ -28,6 +28,12 @@ public Startup(IConfiguration config) public static void ConfigureServices(IServiceCollection services) { + // Shouldn't be a security issue as plaintext isn't chosen by the user and we aren't using auth or sessions + // https://docs.microsoft.com/en-us/aspnet/core/performance/response-compression?view=aspnetcore-6.0#compression-with-secure-protocol + services.AddResponseCompression(options => + { + options.EnableForHttps = true; + }); // AddResponseCaching doesn't appear to add any more services but best to be explicit for the future services.AddResponseCaching(); services.AddControllers(); @@ -65,6 +71,7 @@ public async void Configure( { logger.LogInformation("Configuring Huxley 2 web API application"); + app.UseResponseCompression(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage();