aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/HttpServer/RangeRequestWriter.cs
diff options
context:
space:
mode:
authorClaus Vium <clausvium@gmail.com>2019-03-05 19:20:28 +0100
committerClaus Vium <clausvium@gmail.com>2019-03-05 19:20:28 +0100
commit78742b8e4c658b1f02c9c040b8abb8ee5742bed4 (patch)
tree6ee8afb5b09e9ee85de83fbe231786b9759a9837 /Emby.Server.Implementations/HttpServer/RangeRequestWriter.cs
parent318e0d4a2449baff806afb4ee22dc0f4021ca180 (diff)
Switch to HeaderNames instead of hardcoded strings (and other header related fixes)
Diffstat (limited to 'Emby.Server.Implementations/HttpServer/RangeRequestWriter.cs')
-rw-r--r--Emby.Server.Implementations/HttpServer/RangeRequestWriter.cs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/HttpServer/RangeRequestWriter.cs b/Emby.Server.Implementations/HttpServer/RangeRequestWriter.cs
index 8904e11d3..a0bfe5d8f 100644
--- a/Emby.Server.Implementations/HttpServer/RangeRequestWriter.cs
+++ b/Emby.Server.Implementations/HttpServer/RangeRequestWriter.cs
@@ -7,6 +7,7 @@ using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Model.Services;
using Microsoft.Extensions.Logging;
+using Microsoft.Net.Http.Headers;
namespace Emby.Server.Implementations.HttpServer
{
@@ -66,8 +67,8 @@ namespace Emby.Server.Implementations.HttpServer
this._logger = logger;
ContentType = contentType;
- Headers["Content-Type"] = contentType;
- Headers["Accept-Ranges"] = "bytes";
+ Headers[HeaderNames.ContentType] = contentType;
+ Headers[HeaderNames.AcceptRanges] = "bytes";
StatusCode = HttpStatusCode.PartialContent;
SetRangeValues(contentLength);
@@ -96,7 +97,7 @@ namespace Emby.Server.Implementations.HttpServer
RangeLength = 1 + RangeEnd - RangeStart;
// Content-Length is the length of what we're serving, not the original content
- Headers["Content-Range"] = $"bytes {RangeStart}-{RangeEnd}/{TotalContentLength}";
+ Headers[HeaderNames.ContentRange] = $"bytes {RangeStart}-{RangeEnd}/{TotalContentLength}";
if (RangeStart > 0 && SourceStream.CanSeek)
{