diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-11-03 15:07:48 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-11-03 15:07:48 -0400 |
| commit | 8fd3bf42173e02f3b05c0373072c97e19fb76b9a (patch) | |
| tree | 0bbdb2ba3bbceca88955ceb012c7a07713b95102 /Emby.Common.Implementations/HttpClientManager/HttpClientManager.cs | |
| parent | a2dd144d5ccc8a5092f49983df8a030f7df4f82b (diff) | |
change pcl's to .netstandard
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 } |
