Range fix

This commit is contained in:
Kieran 2023-04-11 22:34:04 +01:00
parent 1c370dfd24
commit 28910368e3
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941

View File

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