diff options
| author | Joshua M. Boniface <joshua@boniface.me> | 2018-12-30 01:04:27 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-30 01:04:27 -0500 |
| commit | 76b647e0a8eddd65dc9c4de7b887a3faf6e12bcc (patch) | |
| tree | a0fcc6a59c597f7c288dd3619c7e72bf97d2e0ea /Emby.Server.Implementations/HttpServer | |
| parent | a86b71899ec52c44ddc6c3018e8cc5e9d7ff4d62 (diff) | |
| parent | d10d632c489b94566bbcf1b7e9c2bb86c31c97b1 (diff) | |
Merge pull request #325 from jellyfin/devv3.5.2-5
Master 3.5.2-5
Diffstat (limited to 'Emby.Server.Implementations/HttpServer')
| -rw-r--r-- | Emby.Server.Implementations/HttpServer/HttpListenerHost.cs | 4 | ||||
| -rw-r--r-- | Emby.Server.Implementations/HttpServer/HttpResultFactory.cs | 13 |
2 files changed, 10 insertions, 7 deletions
diff --git a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs index 0093258e3..70a233c6f 100644 --- a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs +++ b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs @@ -825,7 +825,7 @@ namespace Emby.Server.Implementations.HttpServer }); } - return routes.ToArray(routes.Count); + return routes.ToArray(); } public Func<string, object> GetParseFn(Type propertyType) @@ -954,4 +954,4 @@ namespace Emby.Server.Implementations.HttpServer _listener.Start(UrlPrefixes); } } -}
\ No newline at end of file +} diff --git a/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs b/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs index df493b4c3..a0a471cb2 100644 --- a/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs +++ b/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs @@ -112,12 +112,15 @@ namespace Emby.Server.Implementations.HttpServer /// </summary> private IHasHeaders GetHttpResult(IRequest requestContext, byte[] content, string contentType, bool addCachePrevention, IDictionary<string, string> responseHeaders = null) { - IHasHeaders result; - - var compressionType = requestContext == null ? null : GetCompressionType(requestContext, content, contentType); + string compressionType = null; + bool isHeadRequest = false; - var isHeadRequest = string.Equals(requestContext.Verb, "head", StringComparison.OrdinalIgnoreCase); + if (requestContext != null) { + compressionType = GetCompressionType(requestContext, content, contentType); + isHeadRequest = string.Equals(requestContext.Verb, "head", StringComparison.OrdinalIgnoreCase); + } + IHasHeaders result; if (string.IsNullOrEmpty(compressionType)) { var contentLength = content.Length; @@ -791,4 +794,4 @@ namespace Emby.Server.Implementations.HttpServer { byte[] Compress(byte[] content); } -}
\ No newline at end of file +} |
