diff options
| author | Max Git <rotvel@gmail.com> | 2020-06-03 12:26:50 +0200 |
|---|---|---|
| committer | Max Git <rotvel@gmail.com> | 2020-06-03 12:26:50 +0200 |
| commit | 5df00cb2b8013c143097caa7e350da2be05cc077 (patch) | |
| tree | b763d4f74c62fd215fb86c1a9f267c568e9dd3aa /Emby.Server.Implementations/HttpServer/HttpResultFactory.cs | |
| parent | e81140be206cbb55120e5da23e79e6609a4507e6 (diff) | |
| parent | 40502a33e0f0e3c84487be6d3eff2be35c1448ad (diff) | |
Merge branch 'master' into feature/ffmpeg-version-check
Diffstat (limited to 'Emby.Server.Implementations/HttpServer/HttpResultFactory.cs')
| -rw-r--r-- | Emby.Server.Implementations/HttpServer/HttpResultFactory.cs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs b/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs index 2e9ecc4ae..9d5969583 100644 --- a/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs +++ b/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs @@ -56,6 +56,7 @@ namespace Emby.Server.Implementations.HttpServer /// <summary> /// Gets the result. /// </summary> + /// <param name="requestContext">The request context.</param> /// <param name="content">The content.</param> /// <param name="contentType">Type of the content.</param> /// <param name="responseHeaders">The response headers.</param> @@ -255,16 +256,20 @@ namespace Emby.Server.Implementations.HttpServer { var acceptEncoding = request.Headers[HeaderNames.AcceptEncoding].ToString(); - if (string.IsNullOrEmpty(acceptEncoding)) + if (!string.IsNullOrEmpty(acceptEncoding)) { - //if (_brotliCompressor != null && acceptEncoding.IndexOf("br", StringComparison.OrdinalIgnoreCase) != -1) + // if (_brotliCompressor != null && acceptEncoding.IndexOf("br", StringComparison.OrdinalIgnoreCase) != -1) // return "br"; - if (acceptEncoding.IndexOf("deflate", StringComparison.OrdinalIgnoreCase) != -1) + if (acceptEncoding.Contains("deflate", StringComparison.OrdinalIgnoreCase)) + { return "deflate"; + } - if (acceptEncoding.IndexOf("gzip", StringComparison.OrdinalIgnoreCase) != -1) + if (acceptEncoding.Contains("gzip", StringComparison.OrdinalIgnoreCase)) + { return "gzip"; + } } return null; |
