Remove more Content-Length references

pull/1010/head
Claus Vium 6 years ago
parent 913e80fd55
commit 446f9bf81f

@ -99,12 +99,10 @@ namespace Emby.Server.Implementations.HttpServer
RangeStart = requestedRange.Key; RangeStart = requestedRange.Key;
RangeLength = 1 + RangeEnd - RangeStart; RangeLength = 1 + RangeEnd - RangeStart;
// Content-Length is the length of what we're serving, not the original content
var lengthString = RangeLength.ToString(UsCulture);
var rangeString = $"bytes {RangeStart}-{RangeEnd}/{TotalContentLength}"; var rangeString = $"bytes {RangeStart}-{RangeEnd}/{TotalContentLength}";
Headers[HeaderNames.ContentRange] = rangeString; Headers[HeaderNames.ContentRange] = rangeString;
Logger.LogInformation("Setting range response values for {0}. RangeRequest: {1} Content-Length: {2}, Content-Range: {3}", Path, RangeHeader, lengthString, rangeString); Logger.LogInformation("Setting range response values for {0}. RangeRequest: {1} Content-Range: {2}", Path, RangeHeader, rangeString);
} }
/// <summary> /// <summary>

@ -96,7 +96,6 @@ namespace Emby.Server.Implementations.HttpServer
RangeStart = requestedRange.Key; RangeStart = requestedRange.Key;
RangeLength = 1 + RangeEnd - RangeStart; RangeLength = 1 + RangeEnd - RangeStart;
// Content-Length is the length of what we're serving, not the original content
Headers[HeaderNames.ContentRange] = $"bytes {RangeStart}-{RangeEnd}/{TotalContentLength}"; Headers[HeaderNames.ContentRange] = $"bytes {RangeStart}-{RangeEnd}/{TotalContentLength}";
if (RangeStart > 0 && SourceStream.CanSeek) if (RangeStart > 0 && SourceStream.CanSeek)

@ -25,16 +25,12 @@ namespace MediaBrowser.Model.Services
/// <summary> /// <summary>
/// Adds a new query parameter. /// Adds a new query parameter.
/// </summary> /// </summary>
public virtual void Add(string key, string value) public void Add(string key, string value)
{ {
if (string.Equals(key, "content-length", StringComparison.OrdinalIgnoreCase))
{
return;
}
Add(new NameValuePair(key, value)); Add(new NameValuePair(key, value));
} }
public virtual void Set(string key, string value) private void Set(string key, string value)
{ {
if (string.IsNullOrEmpty(value)) if (string.IsNullOrEmpty(value))
{ {
@ -62,7 +58,7 @@ namespace MediaBrowser.Model.Services
Add(key, value); Add(key, value);
} }
public string Get(string name) private string Get(string name)
{ {
var stringComparison = GetStringComparison(); var stringComparison = GetStringComparison();
@ -77,7 +73,7 @@ namespace MediaBrowser.Model.Services
return null; return null;
} }
public virtual List<NameValuePair> GetItems(string name) private List<NameValuePair> GetItems(string name)
{ {
var stringComparison = GetStringComparison(); var stringComparison = GetStringComparison();
@ -111,20 +107,6 @@ namespace MediaBrowser.Model.Services
return list; return list;
} }
public Dictionary<string, string> ToDictionary()
{
var stringComparer = GetStringComparer();
var headers = new Dictionary<string, string>(stringComparer);
foreach (var pair in this)
{
headers[pair.Name] = pair.Value;
}
return headers;
}
public IEnumerable<string> Keys public IEnumerable<string> Keys
{ {
get get

Loading…
Cancel
Save