-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"URL received is not a git repository." #70
Comments
Review this regexp: // check-01: is this a git repository URL?
regexpGit := `^(?:git|https?|ssh|git@[-\w.]+):(//)?(.*?)(\.git)(/?|#[-\d\w._]+?)$`
valid, err := regexp.MatchString(regexpGit, repository.URL)
if err != nil {
return c.JSON(http.StatusBadRequest, map[string]string{"result": "error", "details": "Internal error."})
}
if !valid {
return c.JSON(http.StatusBadRequest, map[string]string{"result": "error", "details": "URL received is not a git repository."})
} |
Using this repo, the URL should be: |
Sending |
The following repository was stated as not a git repository:
gitlab@gitlab.example.com:example/example.git
The text was updated successfully, but these errors were encountered: