This is an automated email from the ASF dual-hosted git repository.
dgrove pushed a commit to branch master
in repository
https://gitbox.apache.org/repos/asf/incubator-openwhisk-client-go.git
The following commit(s) were added to refs/heads/master by this push:
new 7862108 handle err return from url.Parse in GetUrlBase (#123)
7862108 is described below
commit 7862108c109b7f1bbb47d66edb0a35d4a3c080a7
Author: David Grove <[email protected]>
AuthorDate: Sat Jun 29 14:26:08 2019 -0400
handle err return from url.Parse in GetUrlBase (#123)
This is an attempt to fix wskdeploy issue 1050,
which reported a crash in wskdeploy when the apihost
was a raw host:port without a scheme.
---
whisk/wskprops.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/whisk/wskprops.go b/whisk/wskprops.go
index 2abe7ba..fc3f34b 100644
--- a/whisk/wskprops.go
+++ b/whisk/wskprops.go
@@ -69,7 +69,7 @@ func GetUrlBase(host string) (*url.URL, error) {
urlBase := fmt.Sprintf("%s/api", host)
url, err := url.Parse(urlBase)
- if len(url.Scheme) == 0 || len(url.Host) == 0 {
+ if err != nil || len(url.Scheme) == 0 || len(url.Host) == 0 {
urlBase = fmt.Sprintf("https://%s/api", host)
url, err = url.Parse(urlBase)
}