Git Fetcher: restrain '*.git' URLs matching

This commit is contained in:
wpetit 2020-04-07 08:42:27 +02:00
parent 8c0ce3abe8
commit 4fb04e66bd
1 changed files with 3 additions and 1 deletions

View File

@ -17,6 +17,8 @@ import (
)
const GitScheme = "git"
const HTTPScheme = "http"
const HTTPSScheme = "https"
type GitFetcher struct{}
@ -88,7 +90,7 @@ func (f *GitFetcher) Match(url *url.URL) bool {
return true
}
if strings.HasSuffix(url.Path, ".git") {
if (url.Scheme == HTTPSScheme || url.Scheme == HTTPScheme) && strings.HasSuffix(url.Path, ".git") {
return true
}