From 21d9f5f31dae0a88f84029e04936cab00b3fe475 Mon Sep 17 00:00:00 2001 From: Mark Downie Date: Tue, 17 Jan 2023 23:43:41 -0500 Subject: [PATCH] Removed validation so that the blog can support its own webfinger and redirecting to another fedarated server --- .../DasBlog.Web.Repositories/ActivityPubManager.cs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/source/DasBlog.Web.Repositories/ActivityPubManager.cs b/source/DasBlog.Web.Repositories/ActivityPubManager.cs index 90595f846..4416cc0cb 100644 --- a/source/DasBlog.Web.Repositories/ActivityPubManager.cs +++ b/source/DasBlog.Web.Repositories/ActivityPubManager.cs @@ -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;