diff --git a/source/VMelnalksnis.PaperlessDotNet/Documents/DocumentClient.cs b/source/VMelnalksnis.PaperlessDotNet/Documents/DocumentClient.cs index c146fbc..dd16808 100644 --- a/source/VMelnalksnis.PaperlessDotNet/Documents/DocumentClient.cs +++ b/source/VMelnalksnis.PaperlessDotNet/Documents/DocumentClient.cs @@ -308,7 +308,11 @@ private async Task 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!); }