Merge pull request #12309 from Bond-009/nobuffer

Don't buffer content in GetStaticRemoteStreamResult
This commit is contained in:
Bond-009 2024-07-26 11:16:47 +02:00 committed by GitHub
commit 5fda3f482a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -38,7 +38,7 @@ public static class FileStreamResponseHelpers
} }
// Can't dispose the response as it's required up the call chain. // 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; var contentType = response.Content.Headers.ContentType?.ToString() ?? MediaTypeNames.Text.Plain;
httpContext.Response.Headers[HeaderNames.AcceptRanges] = "none"; httpContext.Response.Headers[HeaderNames.AcceptRanges] = "none";