From 24e5000c3720d9051952c01cf1727161768d919a Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Tue, 23 Sep 2014 14:16:16 +0200 Subject: [PATCH] Use JoinHostPort for URL that browser opens (fixes #732) --- cmd/syncthing/main.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/syncthing/main.go b/cmd/syncthing/main.go index 181ac507..a3a832c0 100644 --- a/cmd/syncthing/main.go +++ b/cmd/syncthing/main.go @@ -487,13 +487,15 @@ nextRepo: proto = "https" } - l.Infof("Starting web GUI on %s://%s/", proto, net.JoinHostPort(hostShow, strconv.Itoa(addr.Port))) + urlShow := fmt.Sprintf("%s://%s/", proto, net.JoinHostPort(hostShow, strconv.Itoa(addr.Port))) + l.Infoln("Starting web GUI on", urlShow) err := startGUI(guiCfg, os.Getenv("STGUIASSETS"), m) if err != nil { l.Fatalln("Cannot start GUI:", err) } if !noBrowser && cfg.Options.StartBrowser && len(os.Getenv("STRESTART")) == 0 { - openURL(fmt.Sprintf("%s://%s:%d", proto, hostOpen, addr.Port)) + urlOpen := fmt.Sprintf("%s://%s/", proto, net.JoinHostPort(hostOpen, strconv.Itoa(addr.Port))) + openURL(urlOpen) } } }