fix: strip non-JSON prefix from gateway status output (#165)
This commit is contained in:
@@ -91,7 +91,8 @@ export async function fetchGatewaySessions(): Promise<SessionLookup | null> {
|
||||
{ timeoutMs: 15_000 },
|
||||
);
|
||||
|
||||
const data = JSON.parse(result.stdout);
|
||||
const jsonStart = result.stdout.indexOf("{");
|
||||
const data = JSON.parse(jsonStart >= 0 ? result.stdout.slice(jsonStart) : result.stdout);
|
||||
const sessions: GatewaySession[] = data?.sessions?.recent ?? [];
|
||||
|
||||
for (const session of sessions) {
|
||||
|
||||
Reference in New Issue
Block a user