diff options
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 +} |
