Skip to content

Commit 6e675d9

Browse files
committed
fix: use async method for crypto flush
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
1 parent d703a5b commit 6e675d9

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/Microsoft.OpenApi/Models/OpenApiDocument.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,8 +581,11 @@ public async Task<string> GetHashCodeAsync(CancellationToken cancellationToken =
581581
using var streamWriter = new StreamWriter(cryptoStream);
582582

583583
await WriteDocumentAsync(streamWriter, cancellationToken).ConfigureAwait(false);
584-
584+
#if NET5_0_OR_GREATER
585+
await cryptoStream.FlushFinalBlockAsync(cancellationToken).ConfigureAwait(false);
586+
#else
585587
cryptoStream.FlushFinalBlock();
588+
#endif
586589

587590
var hash = sha.Hash;
588591
#endif

0 commit comments

Comments
 (0)