mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-05-11 04:16:35 +00:00
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
Block a user