aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/HttpServer
diff options
context:
space:
mode:
authorJoshua M. Boniface <joshua@boniface.me>2018-12-30 01:04:27 -0500
committerGitHub <noreply@github.com>2018-12-30 01:04:27 -0500
commit76b647e0a8eddd65dc9c4de7b887a3faf6e12bcc (patch)
treea0fcc6a59c597f7c288dd3619c7e72bf97d2e0ea /Emby.Server.Implementations/HttpServer
parenta86b71899ec52c44ddc6c3018e8cc5e9d7ff4d62 (diff)
parentd10d632c489b94566bbcf1b7e9c2bb86c31c97b1 (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.cs4
-rw-r--r--Emby.Server.Implementations/HttpServer/HttpResultFactory.cs13
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
+}