From 678721cbad9c2900045986cebd4f18f97354c0d3 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Tue, 20 Mar 2018 20:07:25 +0000 Subject: [PATCH] In hosted template, enable response compression for .wasm --- .../BlazorHosted.CSharp.Server/Startup.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorHosted.CSharp/BlazorHosted.CSharp.Server/Startup.cs b/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorHosted.CSharp/BlazorHosted.CSharp.Server/Startup.cs index e35159da34..e8ece5fa83 100644 --- a/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorHosted.CSharp/BlazorHosted.CSharp.Server/Startup.cs +++ b/src/Microsoft.AspNetCore.Blazor.Templates/content/BlazorHosted.CSharp/BlazorHosted.CSharp.Server/Startup.cs @@ -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, + }); }); }