From 71e9b302d458de555a5c7cf8945d378d5b1c6b66 Mon Sep 17 00:00:00 2001 From: chrislusf Date: Wed, 8 Apr 2015 11:08:08 -0700 Subject: [PATCH] Fix empty public url --- go/weed/server.go | 3 +++ go/weed/volume.go | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/go/weed/server.go b/go/weed/server.go index 39d02597b..910201966 100644 --- a/go/weed/server.go +++ b/go/weed/server.go @@ -228,6 +228,9 @@ func runServer(cmd *Command, args []string) bool { if *volumePublicPort == 0 { *volumePublicPort = *volumePort } + if *serverPublicUrl == "" { + *serverPublicUrl = *serverIp + ":" + strconv.Itoa(*volumePublicPort) + } isSeperatedPublicPort := *volumePublicPort != *volumePort volumeMux := http.NewServeMux() publicVolumeMux := volumeMux diff --git a/go/weed/volume.go b/go/weed/volume.go index 2d3ecbb4d..d3869b281 100644 --- a/go/weed/volume.go +++ b/go/weed/volume.go @@ -101,13 +101,13 @@ func runVolume(cmd *Command, args []string) bool { if *v.ip == "" { *v.ip = "127.0.0.1" } - if *v.publicUrl == "" { - *v.publicUrl = *v.ip + ":" + strconv.Itoa(*v.port) - } if *v.publicPort == 0 { *v.publicPort = *v.port } + if *v.publicUrl == "" { + *v.publicUrl = *v.ip + ":" + strconv.Itoa(*v.publicPort) + } isSeperatedPublicPort := *v.publicPort != *v.port volumeMux := http.NewServeMux()