From 8fe3b29e69d3b6d78304a9e2fbc8437f6b79a9ec Mon Sep 17 00:00:00 2001 From: Gervasio Marchand Date: Tue, 13 Dec 2022 13:12:15 -0300 Subject: [PATCH] Add user agent when pushing to inboxes closes #1 --- src/FakeRelay.Core/Helpers/MastodonHelper.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/FakeRelay.Core/Helpers/MastodonHelper.cs b/src/FakeRelay.Core/Helpers/MastodonHelper.cs index 3061422..b44262d 100644 --- a/src/FakeRelay.Core/Helpers/MastodonHelper.cs +++ b/src/FakeRelay.Core/Helpers/MastodonHelper.cs @@ -19,6 +19,7 @@ public static class MastodonHelper public static async Task 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\""""}}]}}"; -} \ No newline at end of file +}