From fb093185d95153b7bbd8f000b8e43ed47bc9e640 Mon Sep 17 00:00:00 2001 From: Alan Grainger Date: Fri, 15 Nov 2024 18:19:32 +0100 Subject: [PATCH] Add debug logging for unknown error --- app/src/immich.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/immich.ts b/app/src/immich.ts index 741b3ae..1b268a2 100644 --- a/app/src/immich.ts +++ b/app/src/immich.ts @@ -130,7 +130,7 @@ class Immich { password }) const res = await fetch(url) - if ((res.headers.get('Content-Type') || '').includes('application/json')) { + if ((res.headers.get('Content-Type') || '').toLowerCase().includes('application/json')) { const jsonBody = await res.json() if (jsonBody) { if (res.status === 200) { @@ -164,6 +164,7 @@ class Immich { // Otherwise return failure log('Immich response ' + res.status + ' for key ' + key) try { + console.log(res.headers.get('Content-Type')) console.log((await res.text()).slice(0, 500)) } catch (e) { console.log(e)