diff --git a/src/handlers/attachments.ts b/src/handlers/attachments.ts index f13942e..b7fadce 100644 --- a/src/handlers/attachments.ts +++ b/src/handlers/attachments.ts @@ -196,7 +196,7 @@ export async function handleGetAttachment( url: downloadUrl, fileName: attachment.fileName, key: attachment.key, - size: String(attachment.size), + size: Number(attachment.size) || 0, sizeName: attachment.sizeName, }); } @@ -332,10 +332,10 @@ function formatCipherResponse(cipher: Cipher, attachments: Attachment[]): any { attachments: attachments.length > 0 ? attachments.map(a => ({ id: a.id, fileName: a.fileName, - size: String(a.size), + size: Number(a.size) || 0, sizeName: a.sizeName, key: a.key, - url: null, + url: `/api/ciphers/${a.cipherId}/attachment/${a.id}`, object: 'attachment', })) : null, key: cipher.key, diff --git a/src/handlers/ciphers.ts b/src/handlers/ciphers.ts index aaf3c92..3e2257b 100644 --- a/src/handlers/ciphers.ts +++ b/src/handlers/ciphers.ts @@ -10,10 +10,10 @@ function formatAttachments(attachments: Attachment[]): any[] | null { return attachments.map(a => ({ id: a.id, fileName: a.fileName, - size: String(a.size), + size: Number(a.size) || 0, // Android expects Int, not String sizeName: a.sizeName, key: a.key, - url: null, + url: `/api/ciphers/${a.cipherId}/attachment/${a.id}`, // Android requires non-null url! object: 'attachment', })); } diff --git a/src/handlers/sync.ts b/src/handlers/sync.ts index 825c7ea..ea7236f 100644 --- a/src/handlers/sync.ts +++ b/src/handlers/sync.ts @@ -8,10 +8,10 @@ function formatAttachments(attachments: Attachment[]): any[] | null { return attachments.map(a => ({ id: a.id, fileName: a.fileName, - size: String(a.size), + size: Number(a.size) || 0, // Android expects Int, not String sizeName: a.sizeName, key: a.key, - url: null, + url: `/api/ciphers/${a.cipherId}/attachment/${a.id}`, // Android requires non-null url! object: 'attachment', })); }