Skip to content

Commit

Permalink
fix: trailing-slash-safe url parsing
Browse files Browse the repository at this point in the history
closes #104
  • Loading branch information
brian-mulier-p committed Jul 1, 2024
1 parent 5b82a88 commit 70755a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func New(version string, tenant *string) func() *schema.Provider {
"url": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: "The endpoint url without trailing slash",
Description: "The endpoint url",
DefaultFunc: schema.EnvDefaultFunc("KESTRA_URL", ""),
},
"tenant_id": &schema.Schema{
Expand Down Expand Up @@ -111,7 +111,7 @@ func New(version string, tenant *string) func() *schema.Provider {
}

p.ConfigureContextFunc = func(_ context.Context, d *schema.ResourceData) (interface{}, diag.Diagnostics) {
url := d.Get("url").(string)
url := strings.TrimRight(d.Get("url").(string), "/")
username := d.Get("username").(string)
password := d.Get("password").(string)
jwt := d.Get("jwt").(string)
Expand Down

0 comments on commit 70755a5

Please sign in to comment.