aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2019-04-25 07:27:37 +0200
committerGitHub <noreply@github.com>2019-04-25 07:27:37 +0200
commit61d7bed18145cd8b56b748a87b9398fb75332044 (patch)
treeb48499b493aaec6ffdc538c297f865e5259e5063 /Emby.Server.Implementations/HttpServer/HttpResultFactory.cs
parenta0e61ee67f56a6f2735c3f3e8f97e3da794c0c1a (diff)
parent28c2ac528d46ba97b920d37300fa814bd6f4a51a (diff)
Merge pull request #1304 from jellyfin/release-10.3.z
Backmerge 10.3.1
Diffstat (limited to 'Emby.Server.Implementations/HttpServer/HttpResultFactory.cs')
-rw-r--r--Emby.Server.Implementations/HttpServer/HttpResultFactory.cs13
1 files changed, 9 insertions, 4 deletions
diff --git a/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs b/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs
index 134f3c841..5c29988c7 100644
--- a/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs
+++ b/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs
@@ -132,7 +132,7 @@ namespace Emby.Server.Implementations.HttpServer
content = Array.Empty<byte>();
}
- result = new StreamWriter(content, contentType);
+ result = new StreamWriter(content, contentType, contentLength);
}
else
{
@@ -176,7 +176,7 @@ namespace Emby.Server.Implementations.HttpServer
bytes = Array.Empty<byte>();
}
- result = new StreamWriter(bytes, contentType);
+ result = new StreamWriter(bytes, contentType, contentLength);
}
else
{
@@ -335,13 +335,13 @@ namespace Emby.Server.Implementations.HttpServer
if (isHeadRequest)
{
- var result = new StreamWriter(Array.Empty<byte>(), contentType);
+ var result = new StreamWriter(Array.Empty<byte>(), contentType, contentLength);
AddResponseHeaders(result, responseHeaders);
return result;
}
else
{
- var result = new StreamWriter(content, contentType);
+ var result = new StreamWriter(content, contentType, contentLength);
AddResponseHeaders(result, responseHeaders);
return result;
}
@@ -581,6 +581,11 @@ namespace Emby.Server.Implementations.HttpServer
}
else
{
+ if (totalContentLength.HasValue)
+ {
+ responseHeaders["Content-Length"] = totalContentLength.Value.ToString(CultureInfo.InvariantCulture);
+ }
+
if (isHeadRequest)
{
using (stream)