Skip to content

Commit 2268bfd

Browse files
committed
Removed redundant MimeType check
1 parent 3fcf045 commit 2268bfd

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

src/ServiceControl/Infrastructure/Nancy/NancyCompressionExtension.cs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
namespace ServiceBus.Management.Infrastructure.Nancy
22
{
3-
using System.Collections.Generic;
43
using System.IO.Compression;
54
using System.Linq;
65
using global::Nancy;
@@ -19,11 +18,6 @@ public static void CheckForCompression(NancyContext context)
1918
return;
2019
}
2120

22-
if (!ResponseIsCompatibleMimeType(context.Response))
23-
{
24-
return;
25-
}
26-
2721
if (ContentLengthIsTooSmall(context.Response))
2822
{
2923
return;
@@ -63,27 +57,9 @@ static bool ContentLengthIsTooSmall(Response response)
6357
return false;
6458
}
6559

66-
static bool ResponseIsCompatibleMimeType(Response response)
67-
{
68-
return ValidMimes.Any(x => x == response.ContentType);
69-
}
70-
7160
static bool RequestIsGzipCompatible(Request request)
7261
{
7362
return request.Headers.AcceptEncoding.Any(x => x.Contains("gzip"));
7463
}
75-
76-
static readonly List<string> ValidMimes = new List<string>
77-
{
78-
"text/css",
79-
"text/html",
80-
"text/plain",
81-
"application/xml",
82-
"text/xml",
83-
"application/json",
84-
"text/json",
85-
"application/xaml+xml",
86-
"application/x-javascript"
87-
};
8864
}
8965
}

0 commit comments

Comments
 (0)