48 instantiations of RangeItemHeaderValue
Microsoft.AspNetCore.Http.Results (1)
src\Shared\RangeHelper\RangeHelper.cs (1)
126return new RangeItemHeaderValue(start, end);
Microsoft.AspNetCore.Mvc.Core (1)
src\Shared\RangeHelper\RangeHelper.cs (1)
126return new RangeItemHeaderValue(start, end);
Microsoft.AspNetCore.StaticAssets (1)
src\Shared\RangeHelper\RangeHelper.cs (1)
126return new RangeItemHeaderValue(start, end);
Microsoft.AspNetCore.StaticFiles (1)
src\Shared\RangeHelper\RangeHelper.cs (1)
126return new RangeItemHeaderValue(start, end);
Microsoft.AspNetCore.StaticFiles.FunctionalTests (1)
src\Shared\RangeHelper\RangeHelper.cs (1)
126return new RangeItemHeaderValue(start, end);
Microsoft.AspNetCore.StaticFiles.Tests (4)
RangeHelperTests.cs (4)
18var normalizedRange = RangeHelper.NormalizeRange(new RangeItemHeaderValue(start, end), 1); 28var normalizedRange = RangeHelper.NormalizeRange(new RangeItemHeaderValue(null, 0), 1); 40var normalizedRange = RangeHelper.NormalizeRange(new RangeItemHeaderValue(start, end), 3); 51var normalizedRange = RangeHelper.NormalizeRange(new RangeItemHeaderValue(1, 3), 4);
Microsoft.Net.Http.Headers (2)
RangeHeaderValue.cs (1)
43Ranges.Add(new RangeItemHeaderValue(from, to));
RangeItemHeaderValue.cs (1)
234parsedValue = new RangeItemHeaderValue((fromLength == 0 ? (long?)null : (long?)from),
Microsoft.Net.Http.Headers.Tests (37)
RangeHeaderValueTest.cs (19)
33range.Ranges.Add(new RangeItemHeaderValue(1, 3)); 36range.Ranges.Add(new RangeItemHeaderValue(5, null)); 37range.Ranges.Add(new RangeItemHeaderValue(null, 17)); 50range5.Ranges.Add(new RangeItemHeaderValue(1, 2)); 51range5.Ranges.Add(new RangeItemHeaderValue(3, 4)); 53range6.Ranges.Add(new RangeItemHeaderValue(3, 4)); // reverse order of range5 54range6.Ranges.Add(new RangeItemHeaderValue(1, 2)); 72range5.Ranges.Add(new RangeItemHeaderValue(1, 2)); 73range5.Ranges.Add(new RangeItemHeaderValue(3, 4)); 75range6.Ranges.Add(new RangeItemHeaderValue(3, 4)); // reverse order of range5 76range6.Ranges.Add(new RangeItemHeaderValue(1, 2)); 96expected.Ranges.Add(new RangeItemHeaderValue(null, 5)); 97expected.Ranges.Add(new RangeItemHeaderValue(1, 4)); 102expected.Ranges.Add(new RangeItemHeaderValue(1, 2)); 106expected.Ranges.Add(new RangeItemHeaderValue(1, 2)); 107expected.Ranges.Add(new RangeItemHeaderValue(3, null)); 108expected.Ranges.Add(new RangeItemHeaderValue(null, 4)); 135expected.Ranges.Add(new RangeItemHeaderValue(null, 5)); 136expected.Ranges.Add(new RangeItemHeaderValue(1, 4));
RangeItemHeaderValueTest.cs (18)
11Assert.Throws<ArgumentException>(() => new RangeItemHeaderValue(null, null)); 17Assert.Throws<ArgumentOutOfRangeException>(() => new RangeItemHeaderValue(-1, null)); 23Assert.Throws<ArgumentOutOfRangeException>(() => new RangeItemHeaderValue(2, 1)); 29Assert.Throws<ArgumentOutOfRangeException>(() => new RangeItemHeaderValue(null, -1)); 35var rangeItem = new RangeItemHeaderValue(1, 2); 44var rangeItem = new RangeItemHeaderValue(1000000000, 2000000000); 47rangeItem = new RangeItemHeaderValue(5, null); 50rangeItem = new RangeItemHeaderValue(null, 10); 57var rangeItem1 = new RangeItemHeaderValue(1, 2); 58var rangeItem2 = new RangeItemHeaderValue(1, null); 59var rangeItem3 = new RangeItemHeaderValue(null, 2); 60var rangeItem4 = new RangeItemHeaderValue(2, 2); 61var rangeItem5 = new RangeItemHeaderValue(1, 2); 72var rangeItem1 = new RangeItemHeaderValue(1, 2); 73var rangeItem2 = new RangeItemHeaderValue(1, null); 74var rangeItem3 = new RangeItemHeaderValue(null, 2); 75var rangeItem4 = new RangeItemHeaderValue(2, 2); 76var rangeItem5 = new RangeItemHeaderValue(1, 2);
87 references to RangeItemHeaderValue
Microsoft.AspNetCore.Http.Results (13)
HttpResultsHelper.cs (1)
91public static (RangeItemHeaderValue? range, long rangeLength, bool completed) WriteResultAsFileCore(
PhysicalFileHttpResult.cs (1)
140private static Task ExecuteCoreAsync(HttpContext httpContext, RangeItemHeaderValue? range, long rangeLength, string fileName)
src\Shared\RangeHelper\RangeHelper.cs (5)
30/// range request. A <see cref="RangeItemHeaderValue"/> which represents the normalized form of the 34public static (bool isRangeRequest, RangeItemHeaderValue? range) ParseRange( 87var range = NormalizeRange(ranges.Single(), length); 94internal static RangeItemHeaderValue? NormalizeRange(RangeItemHeaderValue range, long length)
src\Shared\ResultsHelpers\FileResultHelper.cs (5)
29internal static async Task WriteFileAsync(HttpContext context, Stream fileStream, RangeItemHeaderValue? range, long rangeLength) 56internal static async Task WriteFileAsync(HttpContext context, ReadOnlyMemory<byte> buffer, RangeItemHeaderValue? range, long rangeLength) 90internal static (RangeItemHeaderValue? range, long rangeLength, bool serveBody) SetHeadersAndLog( 286private static (RangeItemHeaderValue? range, long rangeLength, bool serveBody) SetRangeHeaders( 334private static long SetContentLength(HttpResponse response, RangeItemHeaderValue range)
VirtualFileHttpResult.cs (1)
135private static Task ExecuteCoreAsync(HttpContext httpContext, RangeItemHeaderValue? range, long rangeLength, IFileInfo fileInfo)
Microsoft.AspNetCore.Mvc.Core (22)
Infrastructure\FileContentResultExecutor.cs (2)
54/// <param name="range">The <see cref="RangeItemHeaderValue"/>.</param> 56protected virtual Task WriteFileAsync(ActionContext context, FileContentResult result, RangeItemHeaderValue? range, long rangeLength)
Infrastructure\FileResultExecutorBase.cs (4)
52/// <returns>A tuple with the <see cref="RangeItemHeaderValue"/> range, length, and whether the body was served.</returns> 53protected virtual (RangeItemHeaderValue? range, long rangeLength, bool serveBody) SetHeadersAndLog( 91/// <param name="range">The <see cref="RangeItemHeaderValue"/>.</param> 94protected static async Task WriteFileAsync(HttpContext context, Stream fileStream, RangeItemHeaderValue? range, long rangeLength)
Infrastructure\FileStreamResultExecutor.cs (2)
63/// <param name="range">The <see cref="RangeItemHeaderValue"/>.</param> 68RangeItemHeaderValue? range,
Infrastructure\PhysicalFileResultExecutor.cs (2)
58protected virtual Task WriteFileAsync(ActionContext context, PhysicalFileResult result, RangeItemHeaderValue? range, long rangeLength) 66RangeItemHeaderValue? range,
Infrastructure\VirtualFileResultExecutor.cs (2)
66protected virtual Task WriteFileAsync(ActionContext context, VirtualFileResult result, IFileInfo fileInfo, RangeItemHeaderValue? range, long rangeLength) 77RangeItemHeaderValue? range,
src\Shared\RangeHelper\RangeHelper.cs (5)
30/// range request. A <see cref="RangeItemHeaderValue"/> which represents the normalized form of the 34public static (bool isRangeRequest, RangeItemHeaderValue? range) ParseRange( 87var range = NormalizeRange(ranges.Single(), length); 94internal static RangeItemHeaderValue? NormalizeRange(RangeItemHeaderValue range, long length)
src\Shared\ResultsHelpers\FileResultHelper.cs (5)
29internal static async Task WriteFileAsync(HttpContext context, Stream fileStream, RangeItemHeaderValue? range, long rangeLength) 56internal static async Task WriteFileAsync(HttpContext context, ReadOnlyMemory<byte> buffer, RangeItemHeaderValue? range, long rangeLength) 90internal static (RangeItemHeaderValue? range, long rangeLength, bool serveBody) SetHeadersAndLog( 286private static (RangeItemHeaderValue? range, long rangeLength, bool serveBody) SetRangeHeaders( 334private static long SetContentLength(HttpResponse response, RangeItemHeaderValue range)
Microsoft.AspNetCore.StaticAssets (10)
src\Shared\RangeHelper\RangeHelper.cs (5)
30/// range request. A <see cref="RangeItemHeaderValue"/> which represents the normalized form of the 34public static (bool isRangeRequest, RangeItemHeaderValue? range) ParseRange( 87var range = NormalizeRange(ranges.Single(), length); 94internal static RangeItemHeaderValue? NormalizeRange(RangeItemHeaderValue range, long length)
StaticAssetsInvoker.cs (5)
204private async Task SendRangeAsync(StaticAssetInvocationContext requestContext, RangeItemHeaderValue? range) 244private ContentRangeHeaderValue ComputeContentRange(RangeItemHeaderValue range, out long start, out long length) 286public (PreconditionState, bool isRange, RangeItemHeaderValue? range) ComprehendRequestHeaders() 390private (bool isRangeRequest, RangeItemHeaderValue? range) ComputeRange() 402(var isRangeRequest, var range) = RangeHelper.ParseRange(_context, _requestHeaders, _length, _logger);
Microsoft.AspNetCore.StaticFiles (8)
src\Shared\RangeHelper\RangeHelper.cs (5)
30/// range request. A <see cref="RangeItemHeaderValue"/> which represents the normalized form of the 34public static (bool isRangeRequest, RangeItemHeaderValue? range) ParseRange( 87var range = NormalizeRange(ranges.Single(), length); 94internal static RangeItemHeaderValue? NormalizeRange(RangeItemHeaderValue range, long length)
StaticFileContext.cs (3)
31private RangeItemHeaderValue? _range; 237(var isRangeRequest, var range) = RangeHelper.ParseRange(_context, RequestHeaders, _length, _logger); 399private ContentRangeHeaderValue ComputeContentRange(RangeItemHeaderValue range, out long start, out long length)
Microsoft.AspNetCore.StaticFiles.FunctionalTests (5)
src\Shared\RangeHelper\RangeHelper.cs (5)
30/// range request. A <see cref="RangeItemHeaderValue"/> which represents the normalized form of the 34public static (bool isRangeRequest, RangeItemHeaderValue? range) ParseRange( 87var range = NormalizeRange(ranges.Single(), length); 94internal static RangeItemHeaderValue? NormalizeRange(RangeItemHeaderValue range, long length)
Microsoft.AspNetCore.StaticFiles.Tests (4)
RangeHelperTests.cs (4)
18var normalizedRange = RangeHelper.NormalizeRange(new RangeItemHeaderValue(start, end), 1); 28var normalizedRange = RangeHelper.NormalizeRange(new RangeItemHeaderValue(null, 0), 1); 40var normalizedRange = RangeHelper.NormalizeRange(new RangeItemHeaderValue(start, end), 3); 51var normalizedRange = RangeHelper.NormalizeRange(new RangeItemHeaderValue(1, 3), 4);
Microsoft.Net.Http.Headers (12)
RangeHeaderValue.cs (6)
24private ICollection<RangeItemHeaderValue>? _ranges; 63public ICollection<RangeItemHeaderValue> Ranges 69_ranges = new ObjectCollection<RangeItemHeaderValue>(); 83foreach (var range in Ranges) 121foreach (var range in Ranges) 184var rangesLength = RangeItemHeaderValue.GetRangeItemListLength(input, current, result.Ranges);
RangeItemHeaderValue.cs (6)
13/// The <see cref="RangeItemHeaderValue"/> class provides support for a byte range in a <c>Range</c> as defined 23/// Initializes a new instance of the <see cref="RangeItemHeaderValue"/> class. 84return obj is RangeItemHeaderValue other && ((_from == other._from) && (_to == other._to)); 106ICollection<RangeItemHeaderValue> rangeCollection) 128var rangeLength = GetRangeItemLength(input, current, out var range); 154internal static int GetRangeItemLength(StringSegment input, int startIndex, out RangeItemHeaderValue? parsedValue)
Microsoft.Net.Http.Headers.Tests (13)
RangeItemHeaderValueTest.cs (13)
35var rangeItem = new RangeItemHeaderValue(1, 2); 44var rangeItem = new RangeItemHeaderValue(1000000000, 2000000000); 57var rangeItem1 = new RangeItemHeaderValue(1, 2); 58var rangeItem2 = new RangeItemHeaderValue(1, null); 59var rangeItem3 = new RangeItemHeaderValue(null, 2); 60var rangeItem4 = new RangeItemHeaderValue(2, 2); 61var rangeItem5 = new RangeItemHeaderValue(1, 2); 72var rangeItem1 = new RangeItemHeaderValue(1, 2); 73var rangeItem2 = new RangeItemHeaderValue(1, null); 74var rangeItem3 = new RangeItemHeaderValue(null, 2); 75var rangeItem4 = new RangeItemHeaderValue(2, 2); 76var rangeItem5 = new RangeItemHeaderValue(1, 2); 136var range = ranges.First();