Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/validators/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var (
// These regex patterns ensure the URL is in the format of a valid GitHub or GitLab repository
// For example: // - GitHub: https://github.com/user/repo
githubURLRegex = regexp.MustCompile(`^https?://(www\.)?github\.com/[\w.-]+/[\w.-]+/?$`)
gitlabURLRegex = regexp.MustCompile(`^https?://(www\.)?gitlab\.com/[\w.-]+/[\w.-]+/?$`)
gitlabURLRegex = regexp.MustCompile(`^https?://(www\.)?gitlab\.com/[\w.-]+(?:/[\w.-]+)+/?$`)
)

// IsValidRepositoryURL checks if the given URL is valid for the specified repository source
Expand Down
14 changes: 14 additions & 0 deletions internal/validators/validators_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,20 @@ func TestValidate(t *testing.T) {
},
expectedError: validators.ErrInvalidRepositoryURL.Error(),
},
{
name: "server with valid GitLab URL in nested subgroup",
serverDetail: apiv0.ServerJSON{
Schema: model.CurrentSchemaURL,
Name: "com.example/test-server",
Description: "A test server",
Repository: &model.Repository{
URL: "https://gitlab.com/myorg/team/subgroup/my-mcp-server",
Source: "gitlab",
},
Version: "1.0.0",
},
expectedError: "",
},
{
name: "server with valid repository subfolder",
serverDetail: apiv0.ServerJSON{
Expand Down
Loading