fix(core): Handle symlinks in blocked paths (#17735)

This commit is contained in:
RomanDavydchuk
2025-08-01 10:59:53 +03:00
committed by GitHub
parent e8e7b23d47
commit c2c3e08cdf
5 changed files with 64 additions and 40 deletions

View File

@@ -1,4 +1,5 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import fsPromises from 'fs/promises';
import type { WorkflowTestData } from 'n8n-workflow';
describe('Test ReadWriteFile Node', () => {
@@ -13,6 +14,9 @@ describe('Test ReadWriteFile Node', () => {
const writeFileNode = workflowData.nodes.find((n) => n.name === 'Write to Disk')!;
writeFileNode.parameters.fileName = `${testHarness.temporaryDir}/image-written.jpg`;
const realpathSpy = jest.spyOn(fsPromises, 'realpath');
realpathSpy.mockImplementation(async (path) => path as string);
const tests: WorkflowTestData[] = [
{
description: 'nodes/Files/ReadWriteFile/test/ReadWriteFile.workflow.json',