Open codegurney opened 6 months ago
What version of Flurl.Http?
4.0.2
Looking into this a little more, it is a handled exception, but Rider is still breaking when this exception is thrown. Would it be possible to check for WASM before setting the UseCookies property on HttpClientHandler?
That try/catch is meant to be sort of a future-proof catch-all so Flurl doesn't need to sniff for specific platforms. I'll make a note to look at it, there's some sniffing going on in other areas so this isn't a hard rule. Can you exclude PlatformNotSupportedException from exceptions that Rider breaks on? You can in VS but I'm less familiar with Rider.
And along the lines of future-proofing, if some future version of WASM adds support for UseCookies, this could cause problems. So it's kind of doubtful I'll make a change here, but I will still take a look at it.
Probably. For now, at least in development, I have forked the repo and added... `#if NETCOREAPP if (!OperatingSystem.IsBrowser())
before the call to
handler.UseCookies = false;`
in FlurlClientFactory.cs
maybe add configuration option to toggle whether or not to use cookies?
Using the code from the docs on a Blazor WASM application: `services.AddSingleton(sp => new FlurlClientCache()
.Add("MyCli", "https://some-api.com"));
public MyService(IFlurlClientCache clients) { _flurlCli = clients.Get("MyCli");`
causes a PlatformNotSupportedException. Looking at the stack trace, it looks like it is related to UseCookies.