File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 44 "encoding/json"
55 "fmt"
66 "log/slog"
7+ "net/url"
78 "os"
89 "os/exec"
910 "strings"
@@ -103,12 +104,14 @@ func getEnvVars() []string {
103104 goproxy_servers = append (goproxy_servers , cfg .URL )
104105 slog .Info ("Found GOPROXY server" , slog .String ("url" , cfg .URL ))
105106 } else if cfg .Type == GIT_SOURCE {
106- if strings .HasSuffix (cfg .URL , "*" ) {
107- git_sources = append (git_sources , cfg .URL )
107+ parsed , err := url .Parse (cfg .URL )
108+ if err == nil && parsed .Hostname () != "" {
109+ git_source := parsed .Hostname () + parsed .Path + "*"
110+ git_sources = append (git_sources , git_source )
111+ slog .Info ("Found Git source" , slog .String ("source" , git_source ))
108112 } else {
109- git_sources = append ( git_sources , cfg .URL + "*" )
113+ slog . Warn ( "Not a valid URL for Git source" , slog . String ( "url" , cfg .URL ) )
110114 }
111- slog .Info ("Found Git source" , slog .String ("url" , cfg .URL ))
112115 }
113116 }
114117
You can’t perform that action at this time.
0 commit comments