29 ArgumentNullException.ThrowIfNull(context);
31 ArgumentNullException.ThrowIfNull(result);
35 var cancellationToken = context.HttpContext.RequestAborted;
36 var stream = await result.
GetResult(cancellationToken);
37 var contentLength = stream.Length;
38 var (range, rangeLength, serveBody) = SetHeadersAndLog(context, result, contentLength, result.EnableRangeProcessing);
44 var outputStream = context.HttpContext.Response.Body;
47 await StreamCopyOperation.CopyToAsync(
56 stream.Seek(range.From ?? 0, SeekOrigin.Begin);
57 await StreamCopyOperation.CopyToAsync(
65 catch (OperationCanceledException)
69 context.HttpContext.Abort();