From 22f0dcc0a01807035ac9bfe3d0ebfbcaa5f9740c Mon Sep 17 00:00:00 2001 From: bymyself Date: Mon, 3 Mar 2025 16:48:30 -0700 Subject: [PATCH] Fix handling of templates index.json not found (#2842) --- src/scripts/api.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/scripts/api.ts b/src/scripts/api.ts index 6f098aef4..8a26379ee 100644 --- a/src/scripts/api.ts +++ b/src/scripts/api.ts @@ -420,7 +420,8 @@ export class ComfyApi extends EventTarget { */ async getCoreWorkflowTemplates(): Promise { const res = await axios.get('/templates/index.json') - return res.status === 200 ? res.data : [] + const contentType = res.headers['content-type'] + return contentType?.includes('application/json') ? res.data : [] } /**