Don't buffer content in GetStaticRemoteStreamResult

This commit is contained in:
Bond_009 2024-07-20 13:31:04 +02:00
parent 2b0082bf15
commit 26fcb78ae3

View File

@ -38,7 +38,7 @@ public static class FileStreamResponseHelpers
}
// Can't dispose the response as it's required up the call chain.
var response = await httpClient.GetAsync(new Uri(state.MediaPath), cancellationToken).ConfigureAwait(false);
var response = await httpClient.GetAsync(new Uri(state.MediaPath), HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var contentType = response.Content.Headers.ContentType?.ToString() ?? MediaTypeNames.Text.Plain;
httpContext.Response.Headers[HeaderNames.AcceptRanges] = "none";