Skip to content

Commit d95a4f9

Browse files
fix(provider): accept hostname or url (#73)
1 parent 4240174 commit d95a4f9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

resources/provider.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package resources
33
import (
44
"context"
55
"errors"
6+
"strings"
67

78
"github.com/go-openapi/runtime"
89
httptransport "github.com/go-openapi/runtime/client"
@@ -61,6 +62,9 @@ func ProviderConfigure(ctx context.Context, d *schema.ResourceData) (interface{}
6162
return nil, diag.FromErr(errors.New("zedcloud API key must be set"))
6263
}
6364

65+
if strings.HasPrefix(zedCloudURL, "https://") {
66+
zedCloudURL = strings.TrimPrefix(zedCloudURL, "https://")
67+
}
6468
transport := httptransport.New(zedCloudURL, "/api", []string{"https"})
6569
transport.SetDebug(false)
6670
transport.DefaultAuthentication = BearerToken(token)

0 commit comments

Comments
 (0)