aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Services/HttpResult.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-09-03 03:28:58 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-09-03 03:28:58 -0400
commit2084678266e7e65dde077fc2caee63c0051bf3db (patch)
treed6f6b236ac4da21746a9f3d7ce0cbe8b33761434 /Emby.Server.Implementations/Services/HttpResult.cs
parente0c1d740a3b83775fa1f2f2c3ba1fd985e83d98b (diff)
update service creation
Diffstat (limited to 'Emby.Server.Implementations/Services/HttpResult.cs')
-rw-r--r--Emby.Server.Implementations/Services/HttpResult.cs9
1 files changed, 7 insertions, 2 deletions
diff --git a/Emby.Server.Implementations/Services/HttpResult.cs b/Emby.Server.Implementations/Services/HttpResult.cs
index dfad09f7b..91314c15a 100644
--- a/Emby.Server.Implementations/Services/HttpResult.cs
+++ b/Emby.Server.Implementations/Services/HttpResult.cs
@@ -45,10 +45,15 @@ namespace Emby.Server.Implementations.Services
var bytesResponse = this.Response as byte[];
if (bytesResponse != null)
{
+ var contentLength = bytesResponse.Length;
+
if (response != null)
- response.SetContentLength(bytesResponse.Length);
+ response.SetContentLength(contentLength);
- await responseStream.WriteAsync(bytesResponse, 0, bytesResponse.Length).ConfigureAwait(false);
+ if (contentLength > 0)
+ {
+ await responseStream.WriteAsync(bytesResponse, 0, contentLength).ConfigureAwait(false);
+ }
return;
}