Skip to content

Commit da0ce74

Browse files
authored
Remove trailing slash from SRC_ENDPOINT (#167)
1 parent e6b26cb commit da0ce74

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cmd/src/main.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func readConfig() (*config, error) {
9595
cfg.AccessToken = envToken
9696
}
9797
if *endpoint != "" {
98-
cfg.Endpoint = strings.TrimSuffix(*endpoint, "/")
98+
cfg.Endpoint = *endpoint
9999
}
100100
if cfg.Endpoint == "" {
101101
if endpoint := os.Getenv("SRC_ENDPOINT"); endpoint != "" {
@@ -105,5 +105,8 @@ func readConfig() (*config, error) {
105105
if cfg.Endpoint == "" {
106106
cfg.Endpoint = "https://sourcegraph.com"
107107
}
108+
109+
cfg.Endpoint = strings.TrimSuffix(cfg.Endpoint, "/")
110+
108111
return &cfg, nil
109112
}

0 commit comments

Comments
 (0)