[backend/webfinger] Catch errors in GetWebFingerTemplateFromHostMetaAsync
This commit is contained in:
parent
6ed944156f
commit
b5bfc9a080
1 changed files with 17 additions and 11 deletions
|
@ -72,7 +72,9 @@ public class WebFingerService(HttpClient client, HttpRequestService httpRqSvc) {
|
|||
}
|
||||
|
||||
private async Task<string?> GetWebFingerTemplateFromHostMetaAsync(string hostMetaUrl) {
|
||||
using var res = await client.SendAsync(httpRqSvc.Get(hostMetaUrl, ["application/xrd+xml"]), HttpCompletionOption.ResponseHeadersRead);
|
||||
try {
|
||||
using var res = await client.SendAsync(httpRqSvc.Get(hostMetaUrl, ["application/xrd+xml"]),
|
||||
HttpCompletionOption.ResponseHeadersRead);
|
||||
using var stream = await res.Content.ReadAsStreamAsync();
|
||||
|
||||
var xml = new XmlDocument();
|
||||
|
@ -89,4 +91,8 @@ public class WebFingerService(HttpClient client, HttpRequestService httpRqSvc) {
|
|||
|
||||
return null;
|
||||
}
|
||||
catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue