summary refs log tree commit diff
path: root/ModAS.Server/Controllers/TransactionsController.cs
blob: 8e4e018abe9dbf03e2493289b22e96ed67b286be (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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<IActionResult> PutTransactions(string txnId) {
        if(!Request.Headers.ContainsKey("Authorization") || Request.Headers["Authorization"] != asr.HomeserverToken) return Unauthorized();
        await Request.Body.CopyToAsync(Console.OpenStandardOutput());
        return Ok(new{});
    }
}