Merge pull request #399 from Max-Liu/master
repaired the wrong IP when using in localhost (Mac os x)
Showing
1 changed file
with
3 additions
and
1 deletions
| ... | @@ -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 | } | ... | ... |
-
Please register or sign in to post a comment