summary refs log tree commit diff
path: root/MxApiExtensions/Controllers/Other/GenericProxyController.cs
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2023-11-23 05:43:15 +0100
committerTheArcaneBrony <myrainbowdash949@gmail.com>2023-11-23 05:43:15 +0100
commitd3d95bbb271902391cbd43a11a6a5d72b0ccfaef (patch)
tree29fb4dd65d855a66fa65755fbf8d443a6154dc80 /MxApiExtensions/Controllers/Other/GenericProxyController.cs
parentFix sync (diff)
downloadMxApiExtensions-d3d95bbb271902391cbd43a11a6a5d72b0ccfaef.tar.xz
Add more code
Diffstat (limited to 'MxApiExtensions/Controllers/Other/GenericProxyController.cs')
-rw-r--r--MxApiExtensions/Controllers/Other/GenericProxyController.cs19
1 files changed, 17 insertions, 2 deletions
diff --git a/MxApiExtensions/Controllers/Other/GenericProxyController.cs b/MxApiExtensions/Controllers/Other/GenericProxyController.cs

index bae07c0..36ceab7 100644 --- a/MxApiExtensions/Controllers/Other/GenericProxyController.cs +++ b/MxApiExtensions/Controllers/Other/GenericProxyController.cs
@@ -6,10 +6,15 @@ using MxApiExtensions.Services; namespace MxApiExtensions.Controllers; [ApiController] -[Route("/{*_}")] +[Route("/_matrix/{*_}")] public class GenericController(ILogger<GenericController> logger, MxApiExtensionsConfiguration config, AuthenticationService authenticationService, AuthenticatedHomeserverProviderService authenticatedHomeserverProviderService) : ControllerBase { + /// <summary> + /// Direct proxy to upstream + /// </summary> + /// <param name="_">API path (unused, as Request.Path is used instead)</param> + /// <param name="access_token">Optional access token</param> [HttpGet] public async Task Proxy([FromQuery] string? access_token, string? _) { try { @@ -60,6 +65,11 @@ public class GenericController(ILogger<GenericController> logger, MxApiExtension } } + /// <summary> + /// Direct proxy to upstream + /// </summary> + /// <param name="_">API path (unused, as Request.Path is used instead)</param> + /// <param name="access_token">Optional access token</param> [HttpPost] public async Task ProxyPost([FromQuery] string? access_token, string _) { try { @@ -117,6 +127,11 @@ public class GenericController(ILogger<GenericController> logger, MxApiExtension } } + /// <summary> + /// Direct proxy to upstream + /// </summary> + /// <param name="_">API path (unused, as Request.Path is used instead)</param> + /// <param name="access_token">Optional access token</param> [HttpPut] public async Task ProxyPut([FromQuery] string? access_token, string _) { try { @@ -173,4 +188,4 @@ public class GenericController(ILogger<GenericController> logger, MxApiExtension await Response.CompleteAsync(); } } -} +} \ No newline at end of file