When using AllowHttpStatus on a simple request, it will throw an exception even when the actual status code is 200. Of course, no exception when removing the AllowHttpStatus line.
This code was working in 3.0.0-pre3, I think it's a regression in 3.0.0-pre4.
Could you please take a look ?
var page = await "https://www.google.com"
.AllowHttpStatus(HttpStatusCode.NotFound)
.GetStringAsync();
Thanks for reporting, this looks legit. I did tweak that code recently and it looks like I managed to lose the "or any success status" logic in this case. Will get it fixed (and unit tested) for the next (pre)release. Thanks again!
Fixed released: https://www.nuget.org/packages/Flurl.Http/3.0.0-pre5
Most helpful comment
Fixed released: https://www.nuget.org/packages/Flurl.Http/3.0.0-pre5