From 6eb7acb6d40a140d29254888714e8e373aa4cc08 Mon Sep 17 00:00:00 2001 From: Shirone Date: Wed, 21 Jan 2026 17:21:18 +0100 Subject: [PATCH] fix: Add path validation for optional params in test runner routes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add path validation middleware for optional projectPath and worktreePath parameters in test runner routes to maintain parity with other worktree routes and ensure proper security validation when ALLOWED_ROOT_DIRECTORY is configured. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- apps/server/src/routes/worktree/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/server/src/routes/worktree/index.ts b/apps/server/src/routes/worktree/index.ts index d165dfdf..abf9c522 100644 --- a/apps/server/src/routes/worktree/index.ts +++ b/apps/server/src/routes/worktree/index.ts @@ -146,11 +146,11 @@ export function createWorktreeRoutes( // Test runner routes router.post( '/start-tests', - validatePathParams('worktreePath'), + validatePathParams('worktreePath', 'projectPath?'), createStartTestsHandler(settingsService) ); router.post('/stop-tests', createStopTestsHandler()); - router.get('/test-logs', createGetTestLogsHandler()); + router.get('/test-logs', validatePathParams('worktreePath?'), createGetTestLogsHandler()); // Init script routes router.get('/init-script', createGetInitScriptHandler());