fix: ensure attachment size is formatted as string for compatibility with Bitwarden clients

This commit is contained in:
shuaiplus committed 2026-02-23 14:07:11 +08:00
1 parent cd7b5a361c
commit 874d31e86b
2 files changed
+3 -2

No files matched your search

+2 -1
View File
@@ -11,7 +11,8 @@ export function formatAttachments(attachments: Attachment[]): any[] | null {
return attachments.map(a => ({
id: a.id,
fileName: a.fileName,
size: Number(a.size) || 0, // Android expects Int, not String
// Bitwarden clients decode attachment size as string in cipher payloads.
size: String(Number(a.size) || 0),
sizeName: a.sizeName,
key: a.key,
url: `/api/ciphers/${a.cipherId}/attachment/${a.id}`, // Android requires non-null url!