Switched http compression from gzip to deflate
This commit is contained in:
parent
debc4e6ae5
commit
ecfffba494
|
@ -39,7 +39,7 @@ namespace MediaBrowser.ApiInteraction
|
||||||
|
|
||||||
public BaseClient(HttpClientHandler clientHandler)
|
public BaseClient(HttpClientHandler clientHandler)
|
||||||
{
|
{
|
||||||
clientHandler.AutomaticDecompression = DecompressionMethods.GZip;
|
clientHandler.AutomaticDecompression = DecompressionMethods.Deflate;
|
||||||
|
|
||||||
HttpClient = new HttpClient(clientHandler);
|
HttpClient = new HttpClient(clientHandler);
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,7 +73,7 @@ namespace MediaBrowser.Common.Net.Handlers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual bool GzipResponse
|
public virtual bool CompressResponse
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
@ -92,11 +92,11 @@ namespace MediaBrowser.Common.Net.Handlers
|
||||||
|
|
||||||
private void WriteReponse(Stream stream)
|
private void WriteReponse(Stream stream)
|
||||||
{
|
{
|
||||||
if (GzipResponse)
|
if (CompressResponse)
|
||||||
{
|
{
|
||||||
using (GZipStream gzipStream = new GZipStream(stream, CompressionMode.Compress, false))
|
using (DeflateStream compressedStream = new DeflateStream(stream, CompressionLevel.Fastest, false))
|
||||||
{
|
{
|
||||||
WriteResponseToOutputStream(gzipStream);
|
WriteResponseToOutputStream(compressedStream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -60,9 +60,9 @@ namespace MediaBrowser.Common.Net
|
||||||
{
|
{
|
||||||
Response.SendChunked = true;
|
Response.SendChunked = true;
|
||||||
|
|
||||||
if (handler.GzipResponse)
|
if (handler.CompressResponse)
|
||||||
{
|
{
|
||||||
Response.AddHeader("Content-Encoding", "gzip");
|
Response.AddHeader("Content-Encoding", "deflate");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cacheDuration.Ticks > 0)
|
if (cacheDuration.Ticks > 0)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user