Browse Source

adjust reading ip address

adjust reading ip address
pull/276/head
chrislusf 9 years ago
parent
commit
62074c7653
  1. 2
      go/weed/weed_server/master_server_handlers_admin.go

2
go/weed/weed_server/master_server_handlers_admin.go

@ -46,7 +46,7 @@ func (ms *MasterServer) dirJoinHandler(w http.ResponseWriter, r *http.Request) {
return
}
if *joinMessage.Ip == "" {
*joinMessage.Ip = r.RemoteAddr[0:strings.Index(r.RemoteAddr, ":")]
*joinMessage.Ip = r.RemoteAddr[0:strings.LastIndex(r.RemoteAddr, ":")]
}
if glog.V(4) {
if jsonData, jsonError := json.Marshal(joinMessage); jsonError != nil {

Loading…
Cancel
Save