about summary refs log tree commit diff
path: root/Utilities/LibMatrix.FederationTest/Controllers/Spec/WellKnownController.cs
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-07-16 19:00:05 +0200
committerRory& <root@rory.gay>2025-07-16 19:00:05 +0200
commitc2613aab129c8d1d5aba3b7ed02609059a826c84 (patch)
treeaeb7a3610cae4c15f013ef7181b379f3b53f5534 /Utilities/LibMatrix.FederationTest/Controllers/Spec/WellKnownController.cs
parentFix dependency path for federationtest (diff)
downloadLibMatrix-c2613aab129c8d1d5aba3b7ed02609059a826c84.tar.xz
Federation tuff
Diffstat (limited to 'Utilities/LibMatrix.FederationTest/Controllers/Spec/WellKnownController.cs')
-rw-r--r--Utilities/LibMatrix.FederationTest/Controllers/Spec/WellKnownController.cs19
1 files changed, 19 insertions, 0 deletions
diff --git a/Utilities/LibMatrix.FederationTest/Controllers/Spec/WellKnownController.cs b/Utilities/LibMatrix.FederationTest/Controllers/Spec/WellKnownController.cs
new file mode 100644

index 0000000..b91868c --- /dev/null +++ b/Utilities/LibMatrix.FederationTest/Controllers/Spec/WellKnownController.cs
@@ -0,0 +1,19 @@ +using LibMatrix.Services.WellKnownResolver.WellKnownResolvers; +using Microsoft.AspNetCore.Mvc; + +namespace LibMatrix.FederationTest.Controllers.Spec; + +[ApiController] +[Route(".well-known/")] +public class WellKnownController(ILogger<WellKnownController> logger) : ControllerBase { + static WellKnownController() { + Console.WriteLine("INFO | WellKnownController initialized."); + } + [HttpGet("matrix/server")] + public ServerWellKnown GetMatrixServerWellKnown() { + // {Request.Headers["X-Forwarded-Proto"].FirstOrDefault(Request.Scheme)}:// + return new() { + Homeserver = $"{Request.Headers["X-Forwarded-Host"].FirstOrDefault(Request.Host.Host)}:{Request.Headers["X-Forwarded-Port"].FirstOrDefault("443")}", + }; + } +} \ No newline at end of file