From 836eea7dab19b13de9004fdc75ded61a5abc0475 Mon Sep 17 00:00:00 2001 From: Rob Loranger Date: Thu, 8 Aug 2019 09:22:31 -0700 Subject: [PATCH] newClient must prepend scheme to default host this updates newClient to prepend the scheme https to the default host found in the global config, and only use said host when both the user and host are configured --- api/api.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/api.go b/api/api.go index 35c10fc..92cda2b 100644 --- a/api/api.go +++ b/api/api.go @@ -34,8 +34,8 @@ func newClient(c *cli.Context) (*writeas.Client, error) { } if host := HostURL(c); host != "" { clientConfig.URL = host + "/api" - } else if cfg.Default.Host != "" { - clientConfig.URL = cfg.Default.Host + "/api" + } else if cfg.Default.Host != "" && cfg.Default.User != "" { + clientConfig.URL = "https://" + cfg.Default.Host + "/api" } else if config.IsDev() { clientConfig.URL = config.DevBaseURL + "/api" } else if c.App.Name == "writeas" {