From 120d802729638c7fcb2693d5bd064aea419cf41d Mon Sep 17 00:00:00 2001 From: "sentry[bot]" <39604003+sentry[bot]@users.noreply.github.com> Date: Sat, 29 Aug 2026 23:00:32 +0000 Subject: [PATCH 1/2] Fix repo path validation for framework-specific route segments --- src/utils/repo-path.ts | 2 +- tests/repo-path.test.ts | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/utils/repo-path.ts b/src/utils/repo-path.ts index 22330d275..3a6bd22be 100644 --- a/src/utils/repo-path.ts +++ b/src/utils/repo-path.ts @@ -1,6 +1,6 @@ export const MAX_REPO_PATH_LENGTH = 512 -const REPO_PATH_SEGMENT_PATTERN = /^[a-zA-Z0-9._$+-]+$/ +const REPO_PATH_SEGMENT_PATTERN = /^[a-zA-Z0-9._$+\-\[\]()@]+$/ export function isValidRepoPath(path: string) { if (path === '') { diff --git a/tests/repo-path.test.ts b/tests/repo-path.test.ts index b990d1ebc..21011011a 100644 --- a/tests/repo-path.test.ts +++ b/tests/repo-path.test.ts @@ -34,6 +34,26 @@ assert.equal( 'query delimiters are rejected', ) +assert.equal( + isValidRepoPath( + 'examples/svelte/basic/src/routes/[postId]/+page.svelte', + ), + true, + 'SvelteKit bracket-style dynamic route segments are valid repo path segments', +) + +assert.equal( + isValidRepoPath('examples/react/start-basic/src/routes/(auth)/login.tsx'), + true, + 'Next.js/Remix parenthesis route group segments are valid repo path segments', +) + +assert.equal( + isValidRepoPath('examples/react/start-basic/src/@components/Button.tsx'), + true, + 'at-sign path segments are valid repo path segments', +) + assert.equal( joinRepoPath('examples/react/start-basic', 'src/routes/__root.tsx'), 'examples/react/start-basic/src/routes/__root.tsx', From b7937169cb47cf5f5b40805afb7faad9e074ba50 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Sat, 29 Aug 2026 23:01:24 +0000 Subject: [PATCH 2/2] ci: apply automated fixes --- tests/repo-path.test.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/repo-path.test.ts b/tests/repo-path.test.ts index 21011011a..594dfe176 100644 --- a/tests/repo-path.test.ts +++ b/tests/repo-path.test.ts @@ -35,9 +35,7 @@ assert.equal( ) assert.equal( - isValidRepoPath( - 'examples/svelte/basic/src/routes/[postId]/+page.svelte', - ), + isValidRepoPath('examples/svelte/basic/src/routes/[postId]/+page.svelte'), true, 'SvelteKit bracket-style dynamic route segments are valid repo path segments', )