aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Services/HttpResult.cs
diff options
context:
space:
mode:
authorJoshua M. Boniface <joshua@boniface.me>2019-08-19 14:57:48 -0400
committerGitHub <noreply@github.com>2019-08-19 14:57:48 -0400
commitd95c04787cc4486f4ea5caaef20f6ac407a3f84a (patch)
tree7e3193614c5a132ae63034c2bb7e07956a5670e6 /Emby.Server.Implementations/Services/HttpResult.cs
parent3ba709fcc32d7255a2cb2466dde8c2479130a2bc (diff)
parentd99278da1dcac4d3c60739e864597aa01f916636 (diff)
Merge branch 'master' into h265
Diffstat (limited to 'Emby.Server.Implementations/Services/HttpResult.cs')
-rw-r--r--Emby.Server.Implementations/Services/HttpResult.cs9
1 files changed, 5 insertions, 4 deletions
diff --git a/Emby.Server.Implementations/Services/HttpResult.cs b/Emby.Server.Implementations/Services/HttpResult.cs
index 2b5963a77..095193828 100644
--- a/Emby.Server.Implementations/Services/HttpResult.cs
+++ b/Emby.Server.Implementations/Services/HttpResult.cs
@@ -10,8 +10,6 @@ namespace Emby.Server.Implementations.Services
public class HttpResult
: IHttpResult, IAsyncStreamWriter
{
- public object Response { get; set; }
-
public HttpResult(object response, string contentType, HttpStatusCode statusCode)
{
this.Headers = new Dictionary<string, string>();
@@ -21,6 +19,8 @@ namespace Emby.Server.Implementations.Services
this.StatusCode = statusCode;
}
+ public object Response { get; set; }
+
public string ContentType { get; set; }
public IDictionary<string, string> Headers { get; private set; }
@@ -37,7 +37,7 @@ namespace Emby.Server.Implementations.Services
public async Task WriteToAsync(Stream responseStream, CancellationToken cancellationToken)
{
- var response = RequestContext == null ? null : RequestContext.Response;
+ var response = RequestContext?.Response;
if (this.Response is byte[] bytesResponse)
{
@@ -45,13 +45,14 @@ namespace Emby.Server.Implementations.Services
if (response != null)
{
- response.OriginalResponse.ContentLength = contentLength;
+ response.ContentLength = contentLength;
}
if (contentLength > 0)
{
await responseStream.WriteAsync(bytesResponse, 0, contentLength, cancellationToken).ConfigureAwait(false);
}
+
return;
}