diff options
| author | JP Dillingham <jp@dillingham.me> | 2022-07-20 20:41:02 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2022-07-20 20:41:02 -0500 |
| commit | d52ec889fcf717014e7b29359e56ff15eabd0077 (patch) | |
| tree | b1d2ab3560ecbaba669352f411563ab2d6b58ecd | |
| parent | 2d4a7934831c791cfceb1ec7a37a39d4824aeca1 (diff) | |
| download | slskd-d52ec889fcf717014e7b29359e56ff15eabd0077.tar.gz | |
add endpoint for memory dumps
| -rw-r--r-- | src/slskd/Core/API/Controllers/ApplicationController.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/slskd/Core/API/Controllers/ApplicationController.cs b/src/slskd/Core/API/Controllers/ApplicationController.cs index 3cf3c0a3..ac8be802 100644 --- a/src/slskd/Core/API/Controllers/ApplicationController.cs +++ b/src/slskd/Core/API/Controllers/ApplicationController.cs @@ -136,5 +136,15 @@ namespace slskd.Core.API return Ok(); } + + [HttpGet("dump")] + [Authorize] + public async Task<IActionResult> DumpMemory() + { + using var dumper = new Dumper(); + var file = await dumper.DumpAsync(); + + return PhysicalFile(file, "application/octet-stream", "slskd.dmp"); + } } } |
