Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

Commit 7200f18

Browse files
compress additional mime types
1 parent 775cacf commit 7200f18

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/SqlStreamStore.Server/SqlStreamStoreServerStartup.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
24
using System.Threading.Tasks;
35
using Microsoft.AspNetCore.Builder;
46
using Microsoft.AspNetCore.Hosting;
57
using Microsoft.AspNetCore.Http;
8+
using Microsoft.AspNetCore.ResponseCompression;
69
using Microsoft.Extensions.DependencyInjection;
710
using SqlStreamStore.HAL;
811
using SqlStreamStore.Server.Browser;
@@ -16,6 +19,13 @@ namespace SqlStreamStore.Server
1619
{
1720
internal class SqlStreamStoreServerStartup : IStartup
1821
{
22+
private static readonly IEnumerable<string> s_CompressableMimeTypes = ResponseCompressionDefaults
23+
.MimeTypes.Concat(new[]
24+
{
25+
"application/hal+json",
26+
"text/markdown"
27+
});
28+
1929
private readonly IStreamStore _streamStore;
2030
private readonly SqlStreamStoreMiddlewareOptions _options;
2131

@@ -28,7 +38,7 @@ public SqlStreamStoreServerStartup(
2838
}
2939

3040
public IServiceProvider ConfigureServices(IServiceCollection services) => services
31-
.AddResponseCompression(options => options.MimeTypes = new[] {"application/hal+json"})
41+
.AddResponseCompression(options => options.MimeTypes = s_CompressableMimeTypes)
3242
.AddRouting()
3343
.BuildServiceProvider();
3444

0 commit comments

Comments
 (0)