akamsteeg / AtleX.HaveIBeenPwned

A fully async .NET Standard client library for the API of HaveIBeenPwned.com
https://www.nuget.org/packages/AtleX.HaveIBeenPwned/
MIT License
5 stars 0 forks source link

HttpHaveIBeenPwnedClient.GetAsync(Uri, CancellationToken) resets the output stream even when no data was loaded #20

Closed akamsteeg closed 5 years ago

akamsteeg commented 5 years ago

https://github.com/akamsteeg/AtleX.HaveIBeenPwned/blob/86e51b63b9bc87e072724f6f704e9cf8e3f1832d/src/AtleX.HaveIBeenPwned/Clients/Http/HttpHaveIBeenPwnedClient.cs#L454

HttpHaveIBeenPwnedClient.GetAsync(Uri, CancellationToken) resets the output stream even when no data was loaded. We only need to reset the stream when data was successfully loaded into the resulting MemoryStream.