Skip to content

Commit

Permalink
Merge pull request #572 from spacelift-io/handle-slash-at-endpoint
Browse files Browse the repository at this point in the history
Handle slash at endpoint
  • Loading branch information
akmal-spacelift authored Sep 23, 2024
2 parents bf3e9c1 + a88127a commit 1eeddc6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion spacelift/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,11 @@ func buildClientFromToken(token string) (*internal.Client, error) {

func buildClientFromAPIKeyData(d *schema.ResourceData) (*internal.Client, error) {
// Since validation runs first, we can safely assume that the data is there.
endpoint := fmt.Sprintf("%s/graphql", d.Get("api_key_endpoint").(string))

// Handle / at api_key_endpoint
endpoint := strings.TrimSuffix(d.Get("api_key_endpoint").(string), "/")
endpoint = fmt.Sprintf("%s/graphql", endpoint)

apiKeyID := d.Get("api_key_id").(string)
apiKeySecret := d.Get("api_key_secret").(string)

Expand Down

0 comments on commit 1eeddc6

Please sign in to comment.