summary refs log tree commit diff
path: root/MxApiExtensions/Controllers/WellKnownController.cs
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2023-09-04 02:18:47 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2023-09-04 02:18:47 +0200
commit7e40421d0eaee613be5b807502eb25fafebde5b1 (patch)
treeaf84e4c39fd0c3cfa05e1b66fb566d5cda59607f /MxApiExtensions/Controllers/WellKnownController.cs
parentCode cleanup (diff)
downloadMxApiExtensions-7e40421d0eaee613be5b807502eb25fafebde5b1.tar.xz
Added a lot of utilities
Diffstat (limited to 'MxApiExtensions/Controllers/WellKnownController.cs')
-rw-r--r--MxApiExtensions/Controllers/WellKnownController.cs23
1 files changed, 23 insertions, 0 deletions
diff --git a/MxApiExtensions/Controllers/WellKnownController.cs b/MxApiExtensions/Controllers/WellKnownController.cs
new file mode 100644

index 0000000..b27451f --- /dev/null +++ b/MxApiExtensions/Controllers/WellKnownController.cs
@@ -0,0 +1,23 @@ +using System.Text.Json.Nodes; +using Microsoft.AspNetCore.Mvc; + +namespace MxApiExtensions.Controllers; + +[ApiController] +[Route("/")] +public class WellKnownController : ControllerBase { + private readonly MxApiExtensionsConfiguration _config; + + public WellKnownController(MxApiExtensionsConfiguration config) { + _config = config; + } + + [HttpGet("/.well-known/matrix/client")] + public object GetWellKnown() { + var res = new JsonObject(); + res.Add("m.homeserver", new JsonObject { + { "base_url", Request.Scheme + "://" + Request.Host + "/" }, + }); + return res; + } +}