cmd/web: fix wrong ExternalURL when specify port via CLI flag

Fixes #5936.
pull/5940/head
ᴜɴᴋɴᴡᴏɴ 2020-02-24 21:21:48 +08:00
parent 0c064b1b79
commit 0d6c405ccb
No known key found for this signature in database
GPG Key ID: B43718D76E30A238
1 changed files with 1 additions and 1 deletions

View File

@ -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")
}