Skip to content

Commit

Permalink
Merge pull request #615 from CircleCI-Public/config-hotfix
Browse files Browse the repository at this point in the history
Update ContextRestClient to parse correct endpoint value from config
  • Loading branch information
kelvinkfli authored Aug 4, 2021
2 parents 1ebdd3f + 5c8587a commit ba9cd22
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/context_rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -527,15 +527,15 @@ func (c *ContextRestClient) EnsureExists() error {
// interface via the REST API.
func NewContextRestClient(config settings.Config) (*ContextRestClient, error) {
// Ensure server ends with a slash
if !strings.HasSuffix(config.Endpoint, "/") {
config.Endpoint += "/"
if !strings.HasSuffix(config.RestEndpoint, "/") {
config.RestEndpoint += "/"
}
serverURL, err := url.Parse(config.Host)
if err != nil {
return nil, err
}

serverURL, err = serverURL.Parse(config.Endpoint)
serverURL, err = serverURL.Parse(config.RestEndpoint)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit ba9cd22

Please sign in to comment.