From 4fb04e66bdbccf554874decbac8a9f6e1ffe1c1a Mon Sep 17 00:00:00 2001 From: William Petit Date: Tue, 7 Apr 2020 08:42:27 +0200 Subject: [PATCH] Git Fetcher: restrain '*.git' URLs matching --- internal/project/git.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/project/git.go b/internal/project/git.go index 4df2cb2..cfc942d 100644 --- a/internal/project/git.go +++ b/internal/project/git.go @@ -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 }