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 4
4
"encoding/json"
5
5
"fmt"
6
6
"log/slog"
7
+ "net/url"
7
8
"os"
8
9
"os/exec"
9
10
"strings"
@@ -103,12 +104,14 @@ func getEnvVars() []string {
103
104
goproxy_servers = append (goproxy_servers , cfg .URL )
104
105
slog .Info ("Found GOPROXY server" , slog .String ("url" , cfg .URL ))
105
106
} 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 ))
108
112
} else {
109
- git_sources = append ( git_sources , cfg .URL + "*" )
113
+ slog . Warn ( "Not a valid URL for Git source" , slog . String ( "url" , cfg .URL ) )
110
114
}
111
- slog .Info ("Found Git source" , slog .String ("url" , cfg .URL ))
112
115
}
113
116
}
114
117
You can’t perform that action at this time.
0 commit comments