From 59d33a9c8b59214edc83934defe32b54ba815a8f Mon Sep 17 00:00:00 2001 From: Kwaroran Date: Mon, 6 Jan 2025 23:13:42 +0900 Subject: [PATCH] fix: enhance content-type handling in downloadRisuHub function --- src/ts/characterCards.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ts/characterCards.ts b/src/ts/characterCards.ts index e392a281..579366c4 100644 --- a/src/ts/characterCards.ts +++ b/src/ts/characterCards.ts @@ -1668,9 +1668,9 @@ export async function downloadRisuHub(id:string, arg:{ return } - if(res.headers.get('content-type') === 'image/png' || res.headers.get('content-type') === 'application/zip'){ + if(res.headers.get('content-type') === 'image/png' || res.headers.get('content-type') === 'application/zip' || res.headers.get('content-type') === 'application/charx'){ let db = getDatabase() - if(res.headers.get('content-type') === 'application/zip'){ + if(res.headers.get('content-type') === 'application/zip' || res.headers.get('content-type') === 'application/charx'){ console.log('zip') await importCharacterProcess({ name: 'realm.charx', @@ -1715,6 +1715,7 @@ export async function downloadRisuHub(id:string, arg:{ } } catch (error) { console.error(error) + console.log(error.stack) alertError("Error while importing") } }