mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
fixed double compression issue.
This commit is contained in:
@@ -14,7 +14,9 @@ namespace NzbDrone.Api.Extensions
|
|||||||
|
|
||||||
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);
|
||||||
|
@@ -59,7 +59,8 @@ namespace NzbDrone.Api.Frontend
|
|||||||
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);
|
||||||
|
Reference in New Issue
Block a user