fix: Update path.join -> safeJoinPath for compression utils (#20461)

This commit is contained in:
Stephen Wright 2025-10-07 09:46:33 +01:00 committed by GitHub
parent e67fac66f7
commit ad11e77b42
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,6 +2,7 @@ import * as fflate from 'fflate';
import { readFile, readdir, writeFile, mkdir } from 'fs/promises';
import * as path from 'path';
import { createWriteStream, createReadStream } from 'fs';
import { safeJoinPath } from '@n8n/backend-common';
// Reuse the same compression levels as the Compression node
const ALREADY_COMPRESSED = [
@ -221,7 +222,7 @@ async function addDirectoryToZipStreaming(
continue;
}
const fullPath = path.join(dirPath, entry.name);
const fullPath = safeJoinPath(dirPath, entry.name);
const zipEntryPath = zipPath ? `${zipPath}/${entry.name}` : entry.name;
if (entry.isDirectory()) {