fix: fallback to application/octet-stream for long MIME types in createFileNode

This commit is contained in:
Linus Rath
2026-04-02 11:04:59 +02:00
parent 2e0852b272
commit 05eaaad61f
+3 -1
View File
@@ -4058,7 +4058,9 @@ export class JMAPClient implements IJMAPClient {
async createFileNode(name: string, blobId: string, type: string, size: number, parentId: string | null): Promise<FileNode> {
const accountId = this.getFilesAccountId();
const fileProps: Record<string, unknown> = { name, type, blobId, size };
//fall back for long MIME types
const safeType = type.length > 30 ? 'application/octet-stream' : type;
const fileProps: Record<string, unknown> = { name, type: safeType, blobId, size };
if (parentId !== null) {
fileProps.parentId = parentId;
}