From a847c172069c27fccd95fc593a1b0c630a620d4f Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Sat, 23 Dec 2023 12:07:34 +0100 Subject: Transactions test --- ModAS.Server/Controllers/TransactionsController.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 ModAS.Server/Controllers/TransactionsController.cs (limited to 'ModAS.Server/Controllers/TransactionsController.cs') diff --git a/ModAS.Server/Controllers/TransactionsController.cs b/ModAS.Server/Controllers/TransactionsController.cs new file mode 100644 index 0000000..8e4e018 --- /dev/null +++ b/ModAS.Server/Controllers/TransactionsController.cs @@ -0,0 +1,15 @@ +using System.IO.Pipelines; +using Microsoft.AspNetCore.Mvc; +using ModAS.Server; + +namespace WebApplication1.Controllers; + +[ApiController] +public class TransactionsController(AppServiceRegistration asr) : ControllerBase { + [HttpPut(" /_matrix/app/v1/transactions/{txnId}")] + public async Task PutTransactions(string txnId) { + if(!Request.Headers.ContainsKey("Authorization") || Request.Headers["Authorization"] != asr.HomeserverToken) return Unauthorized(); + await Request.Body.CopyToAsync(Console.OpenStandardOutput()); + return Ok(new{}); + } +} \ No newline at end of file -- cgit 1.5.1