Skip to content

Commit

Permalink
Merge pull request #681 from poppastring/webfinger-validation-fix
Browse files Browse the repository at this point in the history
Fixed for WebFinger account validation
  • Loading branch information
poppastring authored Jan 18, 2023
2 parents 3331d8d + 21d9f5f commit df36b23
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions source/DasBlog.Web.Repositories/ActivityPubManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,24 +97,12 @@ public WebFinger WebFinger(string resource)
{
mastodonAccount = mastodonAccount.Remove(0, 1);
}

var address = new MailAddress(resource);
if (string.Compare(address.User, mastodonAccount, StringComparison.InvariantCultureIgnoreCase) != 0)
{
return null;
}

if (!mastodonUrl.Contains("://"))
{
mastodonUrl = "https://" + mastodonUrl;
}

var host = new Uri(mastodonUrl);
if (string.Compare(address.Host, host.Host, StringComparison.InvariantCultureIgnoreCase) != 0)
{
return null;
}

var mastotonSiteUri = new Uri(mastodonUrl);
string usersUrl = new Uri(mastotonSiteUri, $"users/{mastodonAccount}").AbsoluteUri;
string accountUrl = new Uri(mastotonSiteUri, $"@{mastodonAccount}").AbsoluteUri;
Expand Down

0 comments on commit df36b23

Please sign in to comment.