Skip to content

Commit

Permalink
fix host scheme logic to always run
Browse files Browse the repository at this point in the history
  • Loading branch information
ezekg committed Mar 12, 2024
1 parent 94cf1f6 commit d75be87
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,12 @@ func (c *Client) new(method string, path string, params interface{}) (*http.Requ
}

if c.APIURL == "" {
switch {
case strings.HasPrefix(APIURL, "https://"):
c.APIURL = APIURL
case strings.HasPrefix(APIURL, "http://"):
c.APIURL = APIURL
default:
c.APIURL = "https://" + APIURL
}
c.APIURL = APIURL
}

// Add scheme if not present (e.g. with self-hosted KEYGEN_HOST env var via the CLI)
if !strings.HasPrefix(c.APIURL, "https://") && !strings.HasPrefix(c.APIURL, "http://") {
c.APIURL = "https://" + c.APIURL
}

// Support for custom domains
Expand Down

0 comments on commit d75be87

Please sign in to comment.