Skip to content

Commit

Permalink
feat: Added cancellationtoken-support while reading HttpContent as st…
Browse files Browse the repository at this point in the history
…ream for NET6 and newer
  • Loading branch information
olvr-me committed Nov 30, 2024
1 parent a655dfa commit 717cb97
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,11 @@ private async Task<DocumentContent> DownloadContentCore(Uri requestUri, Cancella
var headers = response.Content.Headers;

return new(
#if NET6_0_OR_GREATER
await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false),
#else
await response.Content.ReadAsStreamAsync().ConfigureAwait(false),
#endif
headers.ContentDisposition,
headers.ContentType!);
}
Expand Down

0 comments on commit 717cb97

Please sign in to comment.