diff options
Diffstat (limited to 'Emby.Common.Implementations/HttpClientManager/HttpClientManager.cs')
| -rw-r--r-- | Emby.Common.Implementations/HttpClientManager/HttpClientManager.cs | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/Emby.Common.Implementations/HttpClientManager/HttpClientManager.cs b/Emby.Common.Implementations/HttpClientManager/HttpClientManager.cs index 4c034fa6a..85fcb556f 100644 --- a/Emby.Common.Implementations/HttpClientManager/HttpClientManager.cs +++ b/Emby.Common.Implementations/HttpClientManager/HttpClientManager.cs @@ -169,9 +169,23 @@ namespace Emby.Common.Implementations.HttpClientManager AddRequestHeaders(httpWebRequest, options); #if NET46 - httpWebRequest.AutomaticDecompression = options.EnableHttpCompression ? - (options.DecompressionMethod ?? DecompressionMethods.Deflate) : - DecompressionMethods.None; + if (options.EnableHttpCompression) + { + if (options.DecompressionMethod.HasValue) + { + httpWebRequest.AutomaticDecompression = options.DecompressionMethod.Value == CompressionMethod.Gzip + ? DecompressionMethods.GZip + : DecompressionMethods.Deflate; + } + else + { + httpWebRequest.AutomaticDecompression = DecompressionMethods.Deflate; + } + } + else + { + httpWebRequest.AutomaticDecompression = DecompressionMethods.None; + } #endif } |
