Retain key for downloaded attachments

This commit is contained in:
trevor-signal 2024-03-18 14:38:52 -04:00 committed by GitHub
parent 6f4730b42c
commit 9ebdf6e399
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,7 +2,7 @@
// SPDX-License-Identifier: AGPL-3.0-only // SPDX-License-Identifier: AGPL-3.0-only
import { createWriteStream } from 'fs'; import { createWriteStream } from 'fs';
import { isNumber, omit } from 'lodash'; import { isNumber } from 'lodash';
import type { Readable } from 'stream'; import type { Readable } from 'stream';
import { Transform } from 'stream'; import { Transform } from 'stream';
import { pipeline } from 'stream/promises'; import { pipeline } from 'stream/promises';
@ -116,7 +116,7 @@ export async function downloadAttachmentV2(
safeUnlinkSync(cipherTextAbsolutePath); safeUnlinkSync(cipherTextAbsolutePath);
return { return {
...omit(attachment, 'key'), ...attachment,
path, path,
size, size,
contentType: contentType contentType: contentType