Guard markdown filename previews by content type

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Dotta
2026-06-01 22:14:06 +00:00
parent a18776c627
commit 2997a47fec
2 changed files with 31 additions and 1 deletions
+2 -1
View File
@@ -63,5 +63,6 @@ export function isMarkdownAttachment(
}
const filename = (attachment.originalFilename ?? "").toLowerCase();
return filename.endsWith(".md") || filename.endsWith(".markdown");
if (!filename.endsWith(".md") && !filename.endsWith(".markdown")) return false;
return contentType === "text/plain" || GENERIC_ATTACHMENT_CONTENT_TYPES.has(contentType);
}