Skip to content

Commit 925d2ba

Browse files
committed
fix(sandbox): remove silent image/png fallback in docx addImage MIME parsing
1 parent 20c2341 commit 925d2ba

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

apps/sim/sandbox-tasks/docx-generate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export const docxGenerateTask = defineSandboxTask<SandboxTaskInput>({
5858
if (comma === -1) throw new Error('addImage: invalid data URI (no comma separator)');
5959
const header = dataUri.slice(0, comma);
6060
const base64 = dataUri.slice(comma + 1);
61-
const mime = header.split(';')[0].replace('data:', '') || 'image/png';
61+
const mime = header.split(';')[0].replace('data:', '');
6262
const extMap = { 'image/png': 'png', 'image/jpeg': 'jpg', 'image/jpg': 'jpg', 'image/gif': 'gif', 'image/bmp': 'bmp', 'image/svg+xml': 'svg' };
6363
const ext = extMap[mime];
6464
if (!ext) throw new Error('addImage: unsupported image type "' + mime + '". Use PNG, JPEG, GIF, BMP, or SVG.');

0 commit comments

Comments
 (0)