e18b9f03 by astaxie

Merge pull request #399 from Max-Liu/master

repaired the wrong IP when using in localhost (Mac os x)
2 parents 3f0e55de b08a4a86
...@@ -98,7 +98,9 @@ func (input *BeegoInput) IP() string { ...@@ -98,7 +98,9 @@ func (input *BeegoInput) IP() string {
98 } 98 }
99 ip := strings.Split(input.Request.RemoteAddr, ":") 99 ip := strings.Split(input.Request.RemoteAddr, ":")
100 if len(ip) > 0 { 100 if len(ip) > 0 {
101 return ip[0] 101 if ip[0] != "["{
102 return ip[0]
103 }
102 } 104 }
103 return "127.0.0.1" 105 return "127.0.0.1"
104 } 106 }
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!