diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-06-15 22:47:20 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-06-15 22:47:20 -0400 |
| commit | 74b57185f698b8330c820f3d01d7554417a391bb (patch) | |
| tree | ee9f2d61c1a6e6c058576f3996bf43df9e88cace /MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs | |
| parent | bd5697625d8510a7430e5e1974d90a557b4d5976 (diff) | |
| parent | 37d7db4bc459f30b9c0d415e72b320590a5328a2 (diff) | |
Merge pull request #1850 from MediaBrowser/dev
Dev
Diffstat (limited to 'MediaBrowser.Common.Implementations/HttpClientManager/HttpClientManager.cs')
| -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) { |
