From 2fb46b3bb9e825727448b6411921f4cfd45c21f2 Mon Sep 17 00:00:00 2001 From: Rory& Date: Tue, 9 Dec 2025 14:44:02 +0100 Subject: Drop MXAE_UPSTREAM header from requests --- Docs/TWIM-TEMPLATE.MD | 15 +++++++++++++++ LibMatrix/Homeservers/FederationClient.cs | 5 +---- LibMatrix/Homeservers/RemoteHomeServer.cs | 1 - 3 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 Docs/TWIM-TEMPLATE.MD diff --git a/Docs/TWIM-TEMPLATE.MD b/Docs/TWIM-TEMPLATE.MD new file mode 100644 index 0000000..7ab633a --- /dev/null +++ b/Docs/TWIM-TEMPLATE.MD @@ -0,0 +1,15 @@ +[TWIM](https://matrix.to/#/%40this-week-in%3Amatrix.org) +### Rory&::LibMatrix ([website](https://cgit.rory.gay/matrix/LibMatrix.git/)) + +*Your friendly .NET 10 Matrix SDK* + +[Funny intro line] + +#### What's new: +- [changelog] + +#### *And, as always:* +- The code is available at [cgit.rory.gay](https://cgit.rory.gay/matrix/LibMatrix.git) or [GitHub](https://github.com/Rory-LibMatrix/LibMatrix)! + - All contributions are more than welcome, be it documentation, code, anything! Perhaps, example usecases, bots, ...? +- Discussion, suggestions and ideas are welcome in [#libmatrix:rory.gay](https://matrix.to/#/#libmatrix:rory.gay) (Space: [#libmatrix-space:rory.gay](https://matrix.to/#/#libmatrix-space:rory.gay)) +- Got a cool project that you're working on and want to share, using LibMatrix? Be sure to let us know, we'd love to hear all about it! \ No newline at end of file diff --git a/LibMatrix/Homeservers/FederationClient.cs b/LibMatrix/Homeservers/FederationClient.cs index 9760e20..310fa93 100644 --- a/LibMatrix/Homeservers/FederationClient.cs +++ b/LibMatrix/Homeservers/FederationClient.cs @@ -10,7 +10,6 @@ public class FederationClient { BaseAddress = new Uri(proxy?.TrimEnd('/') ?? federationEndpoint.TrimEnd('/')), // Timeout = TimeSpan.FromSeconds(120) // TODO: Re-implement this }; - if (proxy is not null) HttpClient.DefaultRequestHeaders.Add("MXAE_UPSTREAM", federationEndpoint); } public MatrixHttpClient HttpClient { get; set; } @@ -18,6 +17,4 @@ public class FederationClient { public async Task GetServerVersionAsync() => await HttpClient.GetFromJsonAsync("/_matrix/federation/v1/version"); public async Task> GetServerKeysAsync() => await HttpClient.GetFromJsonAsync>("/_matrix/key/v2/server"); -} - - +} \ No newline at end of file diff --git a/LibMatrix/Homeservers/RemoteHomeServer.cs b/LibMatrix/Homeservers/RemoteHomeServer.cs index af84be2..7c55d57 100644 --- a/LibMatrix/Homeservers/RemoteHomeServer.cs +++ b/LibMatrix/Homeservers/RemoteHomeServer.cs @@ -23,7 +23,6 @@ public class RemoteHomeserver { // Timeout = TimeSpan.FromSeconds(300) // TODO: Re-implement this }; - if (proxy is not null) ClientHttpClient.DefaultRequestHeaders.Add("MXAE_UPSTREAM", serverName); if (!string.IsNullOrWhiteSpace(wellKnownUris.Server)) FederationClient = new FederationClient(WellKnownUris.Server!, proxy); Auth = new(this); -- cgit 1.5.1