aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs
diff options
context:
space:
mode:
authorJoshua M. Boniface <joshua@boniface.me>2018-12-29 19:39:05 -0500
committerGitHub <noreply@github.com>2018-12-29 19:39:05 -0500
commit64a1a7560ee09b1568e65def65fe51bf84357726 (patch)
treeebf3a5f911228a57ecefb01dfef6bf45e19fd153 /Emby.Server.Implementations/HttpServer/HttpResultFactory.cs
parentff88936f8b1c919ecd900d4355cc0977833fbef2 (diff)
parentaac1007bdc0167c83ef150d199c27cfaed467e44 (diff)
Merge branch 'dev' into fix-issue-320
Diffstat (limited to 'Emby.Server.Implementations/HttpServer/HttpResultFactory.cs')
-rw-r--r--Emby.Server.Implementations/HttpServer/HttpResultFactory.cs13
1 files changed, 8 insertions, 5 deletions
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
+}