aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Core/API/Controllers
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2022-07-20 20:54:16 -0500
committerGitHub <noreply@github.com>2022-07-20 20:54:16 -0500
commit24d4a67c49d9ea59c3c1f324996720fec353aa60 (patch)
treeb1d2ab3560ecbaba669352f411563ab2d6b58ecd /src/slskd/Core/API/Controllers
parent80acf5a658a4c274cb75fa1befd55f5768769c21 (diff)
parentd52ec889fcf717014e7b29359e56ff15eabd0077 (diff)
downloadslskd-24d4a67c49d9ea59c3c1f324996720fec353aa60.tar.gz
Merge pull request #557 from slskd/dump
Add an API endpoint to create and retrieve memory dumps
Diffstat (limited to 'src/slskd/Core/API/Controllers')
-rw-r--r--src/slskd/Core/API/Controllers/ApplicationController.cs10
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");
+ }
}
}