1
0
mirror of https://github.com/astaxie/beego.git synced 2024-06-28 14:34:14 +00:00

Merge pull request #399 from Max-Liu/master

repaired the wrong IP when using in localhost (Mac os x)
This commit is contained in:
astaxie 2013-12-20 06:19:23 -08:00
commit e18b9f0321

View File

@ -98,7 +98,9 @@ func (input *BeegoInput) IP() string {
}
ip := strings.Split(input.Request.RemoteAddr, ":")
if len(ip) > 0 {
return ip[0]
if ip[0] != "["{
return ip[0]
}
}
return "127.0.0.1"
}