diff --git a/option/requestoption.go b/option/requestoption.go index 05868a8..f2bebaa 100644 --- a/option/requestoption.go +++ b/option/requestoption.go @@ -9,6 +9,7 @@ import ( "log" "net/http" "net/url" + "strings" "time" "github.com/gitpod-io/gitpod-sdk-go/internal/requestconfig" @@ -29,6 +30,9 @@ func WithBaseURL(base string) RequestOption { log.Fatalf("failed to parse BaseURL: %s\n", err) } return func(r *requestconfig.RequestConfig) error { + if u.Path != "" && !strings.HasSuffix(u.Path, "/") { + u.Path += "/" + } r.BaseURL = u return nil }