Guard markdown filename previews by content type
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user