Add streaming bulk ENEX migration tool and normalize attachment paths

This commit is contained in:
chrisf committed 2026-10-24 18:51:21 -06:00
1 parent 31b674bf01
commit e74d1ad57b
2 files changed
+632 -1

No files matched your search

+2 -1
View File
@@ -54,7 +54,8 @@ export async function saveAttachmentBuffer(
export function getFullAttachmentPath(storagePath: string): string {
const baseDir = getAttachmentsDir();
const resolved = path.resolve(baseDir, storagePath);
const normalizedStoragePath = storagePath.replace(/\\/g, '/');
const resolved = path.resolve(baseDir, normalizedStoragePath);
if (!resolved.startsWith(path.resolve(baseDir))) {
throw new Error('Invalid storage path');
}