fix: remove dead try/catch in insertNode; fix SENSITIVE_PATHS case-sensitivity (#327)

Drop the no-op try/catch around insertNode.run, and lowercase the Windows
SENSITIVE_PATHS entries so validateProjectPath's case-insensitive check
actually blocks c:\windows. Adds a validateProjectPath test (POSIX +
Windows-gated); the Windows-gated case was validated on a real Windows 11 VM.

Closes #327
This commit is contained in:
Leon.C
2026-05-22 14:13:42 -05:00
committed by GitHub
parent c9d2a25b73
commit 7d5dd4cda7
3 changed files with 54 additions and 28 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ import * as path from 'path';
const SENSITIVE_PATHS = new Set([
'/', '/etc', '/usr', '/bin', '/sbin', '/var', '/tmp', '/dev', '/proc', '/sys',
'/root', '/boot', '/lib', '/lib64', '/opt',
'C:\\', 'C:\\Windows', 'C:\\Windows\\System32',
'c:\\', 'c:\\windows', 'c:\\windows\\system32',
]);
/**