diff --git a/src/server/lib/repositoryUrlValidation.js b/src/server/lib/repositoryUrlValidation.js index 4c7244d..07be80a 100644 --- a/src/server/lib/repositoryUrlValidation.js +++ b/src/server/lib/repositoryUrlValidation.js @@ -2,10 +2,10 @@ * Repository URL validation (JS mirror for server.js). */ const VALID_REPO_URL = - /^(https?:\/\/)(github\.com|gitlab\.com|bitbucket\.org|[^/]+)\/[^/]+\/[^/]+$/; + /^https?:\/\/[^/]+\/.+$/; export const REPO_URL_ERROR_MESSAGE = - 'Invalid repository URL. Supported: GitHub, GitLab, Bitbucket, and custom Git servers (e.g. https://host/owner/repo).'; + 'Invalid repository URL. Supported: GitHub, GitLab, Bitbucket, and custom Git servers (e.g. https://host/owner/repo or https://host/group/sub-group/repo).'; export function isValidRepositoryUrl(url) { if (typeof url !== 'string' || !url.trim()) return false; diff --git a/src/server/lib/repositoryUrlValidation.ts b/src/server/lib/repositoryUrlValidation.ts index 7a37f5e..acf791c 100644 --- a/src/server/lib/repositoryUrlValidation.ts +++ b/src/server/lib/repositoryUrlValidation.ts @@ -4,10 +4,10 @@ */ const VALID_REPO_URL = - /^(https?:\/\/)(github\.com|gitlab\.com|bitbucket\.org|[^/]+)\/[^/]+\/[^/]+$/; + /^https?:\/\/[^/]+\/.+$/; export const REPO_URL_ERROR_MESSAGE = - 'Invalid repository URL. Supported: GitHub, GitLab, Bitbucket, and custom Git servers (e.g. https://host/owner/repo).'; + 'Invalid repository URL. Supported: GitHub, GitLab, Bitbucket, and custom Git servers (e.g. https://host/owner/repo or https://host/group/sub-group/repo).'; export type RepoProvider = 'github' | 'gitlab' | 'bitbucket' | 'custom';