1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-27 02:09:59 +00:00

fixed double compression issue.

This commit is contained in:
kay.one 2013-07-06 23:50:49 -07:00
parent d34b527842
commit aa50be076c
2 changed files with 5 additions and 2 deletions

View file

@ -14,7 +14,9 @@ public static void Handle(NancyContext context)
public static Response CompressResponse(this Response response, Request request) public static Response CompressResponse(this Response response, Request request)
{ {
if (!response.ContentType.Contains("image") && request.Headers.AcceptEncoding.Any(x => x.Contains("gzip"))) if (!response.ContentType.Contains("image")
&& request.Headers.AcceptEncoding.Any(x => x.Contains("gzip"))
&& (!response.Headers.ContainsKey("Content-Encoding") || response.Headers["Content-Encoding"] != "gzip"))
{ {
var data = new MemoryStream(); var data = new MemoryStream();
response.Contents.Invoke(data); response.Contents.Invoke(data);

View file

@ -59,7 +59,8 @@ public Response ProcessStaticResourceRequest(NancyContext context, string workin
response.Headers.DisableCache(); response.Headers.DisableCache();
} }
return response.CompressResponse(context.Request); //return response.CompressResponse(context.Request);
return response;
} }
_logger.Warn("File {0} not found", filePath); _logger.Warn("File {0} not found", filePath);