From 70755a51e986c4d5ca1eae594c34deda07eb5e99 Mon Sep 17 00:00:00 2001 From: "brian.mulier" Date: Mon, 1 Jul 2024 16:21:41 +0200 Subject: [PATCH] fix: trailing-slash-safe url parsing closes #104 --- internal/provider/provider.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/provider/provider.go b/internal/provider/provider.go index e9baba2..1083307 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -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{ @@ -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)