mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-20 17:14:42 +01:00
Cleanup some small things
This commit is contained in:
@@ -15,7 +15,6 @@ namespace Emby.Server.Implementations.Services
|
||||
public HttpResult(object response, string contentType, HttpStatusCode statusCode)
|
||||
{
|
||||
this.Headers = new Dictionary<string, string>();
|
||||
this.Cookies = new List<Cookie>();
|
||||
|
||||
this.Response = response;
|
||||
this.ContentType = contentType;
|
||||
@@ -26,8 +25,6 @@ namespace Emby.Server.Implementations.Services
|
||||
|
||||
public IDictionary<string, string> Headers { get; private set; }
|
||||
|
||||
public List<Cookie> 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)
|
||||
{
|
||||
|
||||
@@ -49,4 +49,4 @@ namespace Emby.Server.Implementations.Services
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user