adjust reading ip address
adjust reading ip address
This commit is contained in:
@@ -46,7 +46,7 @@ func (ms *MasterServer) dirJoinHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if *joinMessage.Ip == "" {
|
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 glog.V(4) {
|
||||||
if jsonData, jsonError := json.Marshal(joinMessage); jsonError != nil {
|
if jsonData, jsonError := json.Marshal(joinMessage); jsonError != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user