Fix Chub import by URL

This commit is contained in:
Cohee
2023-06-28 19:17:16 +03:00
parent 674a15b842
commit 322ab9b47a
2 changed files with 2 additions and 1 deletions

View File

@ -4024,7 +4024,7 @@ async function downloadChubCharacter(id) {
}
const buffer = await result.buffer();
const fileName = result.headers.get('content-disposition').split('filename=')[1];
const fileName = result.headers.get('content-disposition')?.split('filename=')[1] || `${sanitize(id)}.png`;
const fileType = result.headers.get('content-type');
return { buffer, fileName, fileType };