Merge pull request #94 from andrewstuart/bugfix/https

bugfix (cli) Update the URL check to work with https
This commit is contained in:
Soam Vasani
2017-01-31 11:37:08 -08:00
committed by GitHub
+6 -1
View File
@@ -35,7 +35,12 @@ func getClient(serverUrl string) *client.Client {
fatal("Need --server or FISSION_URL set to your fission server.")
}
serverUrl = "http://" + strings.TrimPrefix(serverUrl, "http://")
isHTTPS := strings.Index(serverUrl, "https://") == 0
isHTTP := strings.Index(serverUrl, "http://") == 0
if !(isHTTP || isHTTPS) {
serverUrl = "http://" + serverUrl
}
return client.MakeClient(serverUrl)
}