Skip to content

Commit

Permalink
fix api base url to be the same host (#482)
Browse files Browse the repository at this point in the history
  • Loading branch information
yohamta authored Sep 21, 2023
1 parent 55521af commit 8fa6681
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,7 @@ func LoadConfig(userHomeDir string) error {
}

func (cfg *Config) GetAPIBaseURL() string {
isHTTPS := false
if cfg.TLS != nil && cfg.TLS.CertFile != "" && cfg.TLS.KeyFile != "" {
isHTTPS = true
}
schema := "http"
if isHTTPS {
schema = "https"
}
return fmt.Sprintf("%s://%s:%d%s", schema, cfg.Host, cfg.Port, "/api/v1")
return "/api/v1"
}

func loadEnvs() {
Expand Down

0 comments on commit 8fa6681

Please sign in to comment.