From 07a8e49c4b1e4a2dddbaa49ab6f1ff4f271fbf20 Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Sun, 6 Jan 2019 20:35:36 +0100 Subject: Cleanup some small things --- Emby.Server.Implementations/Services/HttpResult.cs | 10 ++++------ Emby.Server.Implementations/Services/RequestHelper.cs | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'Emby.Server.Implementations/Services') diff --git a/Emby.Server.Implementations/Services/HttpResult.cs b/Emby.Server.Implementations/Services/HttpResult.cs index 91314c15a..66813f461 100644 --- a/Emby.Server.Implementations/Services/HttpResult.cs +++ b/Emby.Server.Implementations/Services/HttpResult.cs @@ -15,7 +15,6 @@ namespace Emby.Server.Implementations.Services public HttpResult(object response, string contentType, HttpStatusCode statusCode) { this.Headers = new Dictionary(); - this.Cookies = new List(); this.Response = response; this.ContentType = contentType; @@ -26,8 +25,6 @@ namespace Emby.Server.Implementations.Services public IDictionary Headers { get; private set; } - public List Cookies { get; private set; } - public int Status { get; set; } public HttpStatusCode StatusCode @@ -40,15 +37,16 @@ namespace Emby.Server.Implementations.Services public async Task WriteToAsync(Stream responseStream, CancellationToken cancellationToken) { - var response = RequestContext != null ? RequestContext.Response : null; + var response = RequestContext == null ? null : RequestContext.Response; - var bytesResponse = this.Response as byte[]; - if (bytesResponse != null) + if (this.Response is byte[] bytesResponse) { var contentLength = bytesResponse.Length; if (response != null) + { response.SetContentLength(contentLength); + } if (contentLength > 0) { diff --git a/Emby.Server.Implementations/Services/RequestHelper.cs b/Emby.Server.Implementations/Services/RequestHelper.cs index 711ba8bbc..7d2fbc3e0 100644 --- a/Emby.Server.Implementations/Services/RequestHelper.cs +++ b/Emby.Server.Implementations/Services/RequestHelper.cs @@ -49,4 +49,4 @@ namespace Emby.Server.Implementations.Services } } -} \ No newline at end of file +} -- cgit v1.2.3