TUN-1190: check URL parse error when starting SSH proxy server
This commit is contained in:
parent
58daf6bfed
commit
c2ac282aca
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue