Add user agent when pushing to inboxes

closes #1
This commit is contained in:
Gervasio Marchand 2022-12-13 13:12:15 -03:00
parent fc90c35642
commit 8fe3b29e69
No known key found for this signature in database
GPG Key ID: B7736CB188DD0A38

View File

@ -19,6 +19,7 @@ public static class MastodonHelper
public static async Task<string> SendMessageToInboxAsync(string targetHost, string content)
{
var client = new HttpClient();
client.DefaultRequestHeaders.Add("User-Agent", $"FakeRelay (hosted at {Config.Instance.Host})");
var date = DateTime.UtcNow;
@ -49,4 +50,4 @@ public static class MastodonHelper
public static string GetActorWebFinger() =>
$@"{{""subject"": ""acct:relay@{Config.Instance.Host}"", ""aliases"": [""https://{Config.Instance.Host}/actor""], ""links"": [{{""href"": ""https://{Config.Instance.Host}/actor"", ""rel"": ""self"", ""type"": ""application/activity+json""}}, {{""href"": ""https://{Config.Instance.Host}/actor"", ""rel"": ""self"", ""type"": ""application/ld+json; profile=\""https://www.w3.org/ns/activitystreams\""""}}]}}";
}
}