Fix handling of templates index.json not found (#2842)

This commit is contained in:
bymyself
2025-03-03 16:48:30 -07:00
committed by GitHub
parent b2f3d85e24
commit 22f0dcc0a0

View File

@@ -420,7 +420,8 @@ export class ComfyApi extends EventTarget {
*/
async getCoreWorkflowTemplates(): Promise<WorkflowTemplates[]> {
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 : []
}
/**