Fix text attachment MIME misclassification (#3628)

* Fix text file attachment detection

* Add file attachment extraction tests
This commit is contained in:
Frank Yang
2026-01-28 18:33:03 -08:00
committed by GitHub
parent a109b7f1a9
commit cb18ce7a85
4 changed files with 364 additions and 13 deletions

View File

@@ -40,7 +40,7 @@ export async function downloadTelegramFile(
filePath: info.file_path,
});
// save with inbound subdir
const saved = await saveMediaBuffer(array, mime, "inbound", maxBytes);
const saved = await saveMediaBuffer(array, mime, "inbound", maxBytes, info.file_path);
// Ensure extension matches mime if possible
if (!saved.contentType && mime) saved.contentType = mime;
return saved;