Fixing debug controller in back

This commit is contained in:
David Négrier 2021-12-03 09:23:31 +01:00
parent 7326e2a38c
commit bf830a67cb

View File

@ -11,7 +11,7 @@ export class DebugController {
} }
getDump() { getDump() {
this.App.get("/dump", (res: HttpResponse, req: HttpRequest) => { this.App.get("/dump", async (res: HttpResponse, req: HttpRequest) => {
const query = parse(req.getQuery()); const query = parse(req.getQuery());
if (query.token !== ADMIN_API_TOKEN) { if (query.token !== ADMIN_API_TOKEN) {
@ -22,7 +22,7 @@ export class DebugController {
.writeStatus("200 OK") .writeStatus("200 OK")
.writeHeader("Content-Type", "application/json") .writeHeader("Content-Type", "application/json")
.end( .end(
stringify(socketManager.getWorlds(), (key: unknown, value: unknown) => { stringify(await Promise.all(socketManager.getWorlds().values()), (key: unknown, value: unknown) => {
if (key === "listeners") { if (key === "listeners") {
return "Listeners"; return "Listeners";
} }