From d01edd7910f2d8dadb1db4d7d86eb156d597bf69 Mon Sep 17 00:00:00 2001 From: Gustav Westling Date: Sun, 26 May 2024 12:15:32 +0200 Subject: [PATCH] whoami debug logs --- tailscale-whoami/whoami.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tailscale-whoami/whoami.ts b/tailscale-whoami/whoami.ts index 253c5fa..b37271c 100644 --- a/tailscale-whoami/whoami.ts +++ b/tailscale-whoami/whoami.ts @@ -28,11 +28,13 @@ const whoami = async (ip: string): Promise => { }, ); - const devices = await jsonResponse.json() as DevicesResponse; + const body = await jsonResponse.text(); + + const devices = JSON.parse(body) as DevicesResponse; if (!devices || !devices.devices) { console.log(`Unexpected devices response`); - console.log(await jsonResponse.text()); + console.log(body); return; }