In Blazor Hosted template, explicitly enable compression for application/octet-stream

Otherwise, the latest ASP.NET Core won't compress those files
This commit is contained in:
Steve Sanderson 2019-03-04 12:17:53 +00:00
parent fdf7f58466
commit 8ae0791735
1 changed files with 5 additions and 1 deletions

View File

@ -14,7 +14,11 @@ namespace BlazorHosted_CSharp.Server
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc().AddNewtonsoftJson();
services.AddResponseCompression();
services.AddResponseCompression(opts =>
{
opts.MimeTypes = ResponseCompressionDefaults.MimeTypes.Concat(
new[] { "application/octet-stream" });
});
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.