Adding checks for subscription url

This commit is contained in:
2dust
2024-10-24 17:09:07 +08:00
parent 3fafc6de93
commit 34f5c0f910
11 changed files with 69 additions and 34 deletions

View File

@@ -81,15 +81,9 @@ namespace ServiceLib.Handler.Fmt
private static ProfileItem? ResolveSip002(string result)
{
Uri parsedUrl;
try
{
parsedUrl = new Uri(result);
}
catch (UriFormatException)
{
return null;
}
var parsedUrl = Utils.TryUri(result);
if (parsedUrl == null) return null;
ProfileItem item = new()
{
Remarks = parsedUrl.GetComponents(UriComponents.Fragment, UriFormat.Unescaped),