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:
parent
fdf7f58466
commit
8ae0791735
|
|
@ -14,7 +14,11 @@ namespace BlazorHosted_CSharp.Server
|
||||||
public void ConfigureServices(IServiceCollection services)
|
public void ConfigureServices(IServiceCollection services)
|
||||||
{
|
{
|
||||||
services.AddMvc().AddNewtonsoftJson();
|
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.
|
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue