From 05eaaad61f6da16f37429d3693653dbaddc34d79 Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Thu, 2 Apr 2026 11:04:59 +0200 Subject: [PATCH] fix: fallback to application/octet-stream for long MIME types in createFileNode --- lib/jmap/client.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/jmap/client.ts b/lib/jmap/client.ts index db2c6868..3fde1a3a 100644 --- a/lib/jmap/client.ts +++ b/lib/jmap/client.ts @@ -4058,7 +4058,9 @@ export class JMAPClient implements IJMAPClient { async createFileNode(name: string, blobId: string, type: string, size: number, parentId: string | null): Promise { const accountId = this.getFilesAccountId(); - const fileProps: Record = { name, type, blobId, size }; + //fall back for long MIME types + const safeType = type.length > 30 ? 'application/octet-stream' : type; + const fileProps: Record = { name, type: safeType, blobId, size }; if (parentId !== null) { fileProps.parentId = parentId; }