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.IsPwnedPasswordInternalAsync(string, CancellationToken) does not properly observe the cancellation token #19

Closed akamsteeg closed 5 years ago

akamsteeg commented 5 years ago

In HttpHaveIBeenPwnedClient.IsPwnedPasswordInternalAsync(string, CancellationToken) we only observe the CancellationToken when requesting data from the HaveIBeenPwned.com service. However, after that we read the complete response and while doing that we ignore the CancellationToken.

Suggestion: Call cancellationToken.ThrowIfCancellationRequested() in the response parsing loop.