In hosted template, enable response compression for .wasm

This commit is contained in:
Steve Sanderson 2018-03-20 20:07:25 +00:00
parent 4eb78b3a8f
commit 678721cbad
1 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNetCore.Blazor.Server;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.ResponseCompression;
@ -24,8 +25,11 @@ namespace BlazorHosted.CSharp.Server
services.AddResponseCompression(options =>
{
options.MimeTypes = ResponseCompressionDefaults.MimeTypes
.Concat(new[] { MediaTypeNames.Application.Octet });
options.MimeTypes = ResponseCompressionDefaults.MimeTypes.Concat(new[]
{
MediaTypeNames.Application.Octet,
WasmMediaTypeNames.Application.Wasm,
});
});
}