mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-02-15 07:28:59 +00:00
Fix non-renderable media files losing filename on upload
This commit is contained in:
@@ -28,7 +28,7 @@ import {
|
||||
import { missingCaseError } from './missingCaseError.std.js';
|
||||
import { uuidToBytes } from './uuidToBytes.std.js';
|
||||
import { DAY } from './durations/index.std.js';
|
||||
import { isVisualMedia } from './Attachment.std.js';
|
||||
import { isImageAttachment, isVideoAttachment } from './Attachment.std.js';
|
||||
import { getAbsoluteAttachmentPath } from './migrations.preload.js';
|
||||
import { isMoreRecentThan } from './timestamp.std.js';
|
||||
|
||||
@@ -90,8 +90,10 @@ export async function uploadAttachment(
|
||||
|
||||
const { blurHash, caption, clientUuid, flags, height, width } = attachment;
|
||||
|
||||
// Strip filename for visual media (images and videos) to prevent metadata leakage
|
||||
const fileName = isVisualMedia(attachment) ? undefined : attachment.fileName;
|
||||
// Strip filename only for renderable visual media to prevent metadata leakage
|
||||
const shouldStripFilename =
|
||||
isImageAttachment(attachment) || isVideoAttachment(attachment);
|
||||
const fileName = shouldStripFilename ? undefined : attachment.fileName;
|
||||
|
||||
return {
|
||||
cdnKey,
|
||||
|
||||
Reference in New Issue
Block a user