From 198f3108ef6c156213d347e58c852e0c5ca1da63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Hatcher?= Date: Sun, 6 Jul 2025 17:33:55 +0200 Subject: [PATCH] FIX: Remove wrong content-type is sharing workbooks This failed to share workbooks with emojis, for instance --- .../frontend/src/components/ShareWorkbookDialog.tsx | 3 +-- webapp/app.ironcalc.com/frontend/src/components/rpc.ts | 6 +----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/webapp/app.ironcalc.com/frontend/src/components/ShareWorkbookDialog.tsx b/webapp/app.ironcalc.com/frontend/src/components/ShareWorkbookDialog.tsx index bb7d950..3adbc63 100644 --- a/webapp/app.ironcalc.com/frontend/src/components/ShareWorkbookDialog.tsx +++ b/webapp/app.ironcalc.com/frontend/src/components/ShareWorkbookDialog.tsx @@ -17,8 +17,7 @@ function ShareWorkbookDialog(properties: { const generateUrl = async () => { if (properties.model) { const bytes = properties.model.toBytes(); - const fileName = properties.model.getName(); - const hash = await shareModel(bytes, fileName); + const hash = await shareModel(bytes); setUrl(`${location.origin}/?model=${hash}`); } }; diff --git a/webapp/app.ironcalc.com/frontend/src/components/rpc.ts b/webapp/app.ironcalc.com/frontend/src/components/rpc.ts index 3890678..bb1dcfd 100644 --- a/webapp/app.ironcalc.com/frontend/src/components/rpc.ts +++ b/webapp/app.ironcalc.com/frontend/src/components/rpc.ts @@ -81,15 +81,11 @@ export async function downloadModel(bytes: Uint8Array, fileName: string) { a.remove(); } -export async function shareModel( - bytes: Uint8Array, - fileName: string, -): Promise { +export async function shareModel(bytes: Uint8Array): Promise { const response = await fetch("/api/share", { method: "POST", headers: { "Content-Type": "application/octet-stream", - "Content-Disposition": `attachment; filename="${fileName}"`, }, body: bytes, });