mirror of
https://github.com/n8n-io/n8n.git
synced 2026-10-24 12:19:44 +08:00
fix: Update path.join -> safeJoinPath for compression utils (#20461)
This commit is contained in:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user