Bugfix range size

This commit is contained in:
Kieran 2023-03-04 19:37:07 +00:00
parent 5bf357bf4b
commit 49ad601d13
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941

View File

@ -7,10 +7,7 @@ public sealed record RangeRequest(long? TotalSize, long? Start, long? End)
public string OriginalString { get; private init; } public string OriginalString { get; private init; }
public long? Size public long? Size
=> Start.HasValue ? (End ?? Math.Min(TotalSize!.Value, Start.Value + DefaultBufferSize)) - Start.Value : End; => (Start.HasValue ? (End ?? Math.Min(TotalSize!.Value, Start.Value + DefaultBufferSize)) - Start.Value : End) + 1L;
public bool IsForFullFile
=> Start is 0 && !End.HasValue;
/// <summary> /// <summary>
/// Return Content-Range header content for this range /// Return Content-Range header content for this range