From 36094fb73f241557a51f63c2868f4d989d0a0c08 Mon Sep 17 00:00:00 2001 From: Eric Blanquer Date: Fri, 23 Jan 2026 20:39:25 +0100 Subject: [PATCH] fix: encode Windows paths correctly in addProjectManually The regex only replaced forward slashes, causing Windows paths like C:\Users\Eric\my_project to remain unchanged instead of being encoded to C--Users-Eric-my-project. This caused API routes to fail. --- server/projects.js | 2 +- server/routes/projects.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/projects.js b/server/projects.js index b4606f8..475b323 100755 --- a/server/projects.js +++ b/server/projects.js @@ -1095,7 +1095,7 @@ async function addProjectManually(projectPath, displayName = null) { } // Generate project name (encode path for use as directory name) - const projectName = absolutePath.replace(/\//g, '-'); + const projectName = absolutePath.replace(/[\\/:\s~_]/g, '-'); // Check if project already exists in config const config = await loadProjectConfig(); diff --git a/server/routes/projects.js b/server/routes/projects.js index 863fd7f..4208f7b 100644 --- a/server/routes/projects.js +++ b/server/routes/projects.js @@ -353,7 +353,7 @@ router.get('/clone-progress', async (req, res) => { let githubToken = null; if (githubTokenId) { - const token = await getGithubTokenById(parseInt(githubTokenId), req.user?.id); + const token = await getGithubTokenById(parseInt(githubTokenId), req.user.id); if (token) { githubToken = token.github_token; }