From 7d0d522fa7fdd3480651642dbda5c44dad8dbe91 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 12 Feb 2020 20:04:31 +0100 Subject: [PATCH] internal: prevent empty endpoint path from resulting in "." sub-paths --- internal/client.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/client.go b/internal/client.go index 4335a93..f7d4fd8 100644 --- a/internal/client.go +++ b/internal/client.go @@ -27,6 +27,10 @@ func NewClient(c *http.Client, endpoint string) (*Client, error) { if err != nil { return nil, err } + if u.Path == "" { + // This is important to avoid issues with path.Join + u.Path = "/" + } return &Client{http: c, endpoint: u}, nil }