From d338b0c67a883434ea097a96a3e356ba338f91d6 Mon Sep 17 00:00:00 2001 From: Philippe-Adrien Nousse Date: Fri, 13 Jul 2018 13:41:51 +0200 Subject: [PATCH] fix invalid instance url --- client/client.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/client/client.go b/client/client.go index 43e6656..a049450 100644 --- a/client/client.go +++ b/client/client.go @@ -56,10 +56,14 @@ type Client struct { } func NewClient(hostname string) (*Client, error) { - baseURL, err := url.Parse(hostname) + baseURL, err := url.ParseRequestURI(hostname) if err != nil { - return nil, err + baseURL, err = url.ParseRequestURI("https://" + hostname) + if err != nil { + return nil, err + } } + c := Client{ baseURL: baseURL, headers: map[string]string{