aboutsummaryrefslogtreecommitdiff
path: root/internal/cmd/web.go
diff options
context:
space:
mode:
authorᴜɴᴋɴᴡᴏɴ <u@gogs.io>2020-02-24 21:21:48 +0800
committerᴜɴᴋɴᴡᴏɴ <u@gogs.io>2020-02-24 21:21:48 +0800
commit0d6c405ccbde9d20889893168f9f9599118e3f5c (patch)
tree32534aa4d242bea5b64d53b47adf1e9913758120 /internal/cmd/web.go
parent0c064b1b79bc5fe0558fb5ba1a185cfc27a77f75 (diff)
cmd/web: fix wrong ExternalURL when specify port via CLI flag
Fixes #5936.
Diffstat (limited to 'internal/cmd/web.go')
-rw-r--r--internal/cmd/web.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/cmd/web.go b/internal/cmd/web.go
index e78eefcc..0d7cc6de 100644
--- a/internal/cmd/web.go
+++ b/internal/cmd/web.go
@@ -683,7 +683,7 @@ func runWeb(c *cli.Context) error {
// Flag for port number in case first time run conflict.
if c.IsSet("port") {
- conf.Server.URL.Host = strings.Replace(conf.Server.URL.Host, conf.Server.URL.Port(), c.String("port"), 1)
+ conf.Server.URL.Host = strings.Replace(conf.Server.URL.Host, ":"+conf.Server.URL.Port(), ":"+c.String("port"), 1)
conf.Server.ExternalURL = conf.Server.URL.String()
conf.Server.HTTPPort = c.String("port")
}