fix invalid instance url

This commit is contained in:
Philippe-Adrien Nousse 2018-07-13 13:41:51 +02:00
parent 2f652e2193
commit d338b0c67a

View File

@ -56,10 +56,14 @@ type Client struct {
} }
func NewClient(hostname string) (*Client, error) { func NewClient(hostname string) (*Client, error) {
baseURL, err := url.Parse(hostname) baseURL, err := url.ParseRequestURI(hostname)
if err != nil {
baseURL, err = url.ParseRequestURI("https://" + hostname)
if err != nil { if err != nil {
return nil, err return nil, err
} }
}
c := Client{ c := Client{
baseURL: baseURL, baseURL: baseURL,
headers: map[string]string{ headers: map[string]string{