TUN-1190: check URL parse error when starting SSH proxy server

This commit is contained in:
Nick Vollmar 2018-11-12 11:45:47 -06:00
parent 58daf6bfed
commit c2ac282aca
1 changed files with 1 additions and 1 deletions

View File

@ -311,7 +311,7 @@ func StartServer(c *cli.Context, version string, shutdownC, graceShutdownC chan
c.Set("url", "https://"+helloListener.Addr().String())
}
if uri, _ := url.Parse(c.String("url")); uri.Scheme == "ssh" {
if uri, err := url.Parse(c.String("url")); err == nil && uri.Scheme == "ssh" {
host := uri.Host
if uri.Port() == "" { // default to 22
host = uri.Hostname() + ":22"