diff options
Diffstat (limited to 'MediaBrowser.Common.Implementations/HttpClientManager')
| -rw-r--r-- | MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs b/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs index f9dbd766f..ce1e9fd7f 100644 --- a/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs +++ b/MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs @@ -143,7 +143,7 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager }; } - private WebRequest GetRequest(HttpRequestOptions options, string method, bool enableHttpCompression) + private WebRequest GetRequest(HttpRequestOptions options, string method) { var request = CreateWebRequest(options.Url); var httpWebRequest = request as HttpWebRequest; @@ -154,7 +154,9 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager AddRequestHeaders(httpWebRequest, options); - httpWebRequest.AutomaticDecompression = enableHttpCompression ? DecompressionMethods.Deflate : DecompressionMethods.None; + httpWebRequest.AutomaticDecompression = options.EnableHttpCompression ? + (options.DecompressionMethod ?? DecompressionMethods.Deflate) : + DecompressionMethods.None; } request.CachePolicy = new RequestCachePolicy(RequestCacheLevel.BypassCache); @@ -366,7 +368,7 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager }; } - var httpWebRequest = GetRequest(options, httpMethod, options.EnableHttpCompression); + var httpWebRequest = GetRequest(options, httpMethod); if (options.RequestContentBytes != null || !string.IsNullOrEmpty(options.RequestContent) || @@ -556,7 +558,7 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager options.CancellationToken.ThrowIfCancellationRequested(); - var httpWebRequest = GetRequest(options, "GET", options.EnableHttpCompression); + var httpWebRequest = GetRequest(options, "GET"); if (options.ResourcePool != null) { |
