Catch http errors early in WebFingerService

This commit is contained in:
Laura Hausmann 2024-01-28 23:03:09 +01:00
parent f4a584b46a
commit dc45ba8adc
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -26,7 +26,7 @@ public class WebFingerService(HttpClient client, HttpRequestService httpRqSvc) {
var req = httpRqSvc.Get(webFingerUrl, ["application/jrd+json", "application/json"]); var req = httpRqSvc.Get(webFingerUrl, ["application/jrd+json", "application/json"]);
var res = await client.SendAsync(req); var res = await client.SendAsync(req);
if (!res.IsSuccessStatusCode) return null;
return await res.Content.ReadFromJsonAsync<WebFingerResponse>(); return await res.Content.ReadFromJsonAsync<WebFingerResponse>();
} }