aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Services
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Server.Implementations/Services')
-rw-r--r--Emby.Server.Implementations/Services/HttpResult.cs7
-rw-r--r--Emby.Server.Implementations/Services/ResponseHelper.cs7
2 files changed, 1 insertions, 13 deletions
diff --git a/Emby.Server.Implementations/Services/HttpResult.cs b/Emby.Server.Implementations/Services/HttpResult.cs
index 296da2f7a..b6758486c 100644
--- a/Emby.Server.Implementations/Services/HttpResult.cs
+++ b/Emby.Server.Implementations/Services/HttpResult.cs
@@ -43,14 +43,9 @@ namespace Emby.Server.Implementations.Services
{
var contentLength = bytesResponse.Length;
- if (response != null)
- {
- response.SetContentLength(contentLength);
- }
-
if (contentLength > 0)
{
- await responseStream.WriteAsync(bytesResponse, 0, contentLength).ConfigureAwait(false);
+ await responseStream.WriteAsync(bytesResponse, 0, contentLength, cancellationToken).ConfigureAwait(false);
}
return;
}
diff --git a/Emby.Server.Implementations/Services/ResponseHelper.cs b/Emby.Server.Implementations/Services/ResponseHelper.cs
index dc9975347..0301ff335 100644
--- a/Emby.Server.Implementations/Services/ResponseHelper.cs
+++ b/Emby.Server.Implementations/Services/ResponseHelper.cs
@@ -20,8 +20,6 @@ namespace Emby.Server.Implementations.Services
{
response.StatusCode = (int)HttpStatusCode.NoContent;
}
-
- response.SetContentLength(0);
return Task.CompletedTask;
}
@@ -55,7 +53,6 @@ namespace Emby.Server.Implementations.Services
{
if (string.Equals(responseHeaders.Key, "Content-Length", StringComparison.OrdinalIgnoreCase))
{
- response.SetContentLength(long.Parse(responseHeaders.Value));
continue;
}
@@ -104,7 +101,6 @@ namespace Emby.Server.Implementations.Services
if (bytes != null)
{
response.ContentType = "application/octet-stream";
- response.SetContentLength(bytes.Length);
if (bytes.Length > 0)
{
@@ -117,7 +113,6 @@ namespace Emby.Server.Implementations.Services
if (responseText != null)
{
bytes = Encoding.UTF8.GetBytes(responseText);
- response.SetContentLength(bytes.Length);
if (bytes.Length > 0)
{
return response.OutputStream.WriteAsync(bytes, 0, bytes.Length, cancellationToken);
@@ -149,8 +144,6 @@ namespace Emby.Server.Implementations.Services
var contentLength = ms.Length;
- response.SetContentLength(contentLength);
-
if (contentLength > 0)
{
await ms.CopyToAsync(response.OutputStream).ConfigureAwait(false);