This repository has been archived on 2024-03-29. You can view files and clone it, but cannot push or open issues or pull requests.
FreeSR/FreeSR.Admin/Handlers/ExecuteCommandRequestHandler.cs

24 lines
654 B
C#
Raw Normal View History

2024-01-27 13:06:07 +00:00
namespace FreeSR.Admin.Handlers
{
using Ceen;
using FreeSR.Admin.Command;
using FreeSR.Shared.Command;
internal class ExecuteCommandRequestHandler : IHttpModule
{
public async Task<bool> HandleAsync(IHttpContext context)
{
var query = context.Request.QueryString;
string command = query["command"];
var ctx = new AdminCommandContext();
CommandManager.Instance.Invoke(ctx, command);
context.Response.StatusCode = HttpStatusCode.OK;
await context.Response.WriteAllAsync(ctx.Message, "text/plain");
return true;
}
}
}