fixed client ip
This commit is contained in:
parent
fa65b381a4
commit
c565dd5ece
2 changed files with 11 additions and 2 deletions
|
|
@ -5,6 +5,12 @@
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
|
import "net"
|
||||||
|
|
||||||
func clientip(ip string) string {
|
func clientip(ip string) string {
|
||||||
|
if ip == "@" {
|
||||||
return ip
|
return ip
|
||||||
|
}
|
||||||
|
host, _, _ := net.SplitHostPort(ip)
|
||||||
|
return host
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,12 @@
|
||||||
|
|
||||||
package types
|
package types
|
||||||
|
|
||||||
|
import "net"
|
||||||
|
|
||||||
func clientip(ip string) string {
|
func clientip(ip string) string {
|
||||||
if ip == "" {
|
if ip == "" {
|
||||||
return "@"
|
return "@"
|
||||||
}
|
}
|
||||||
return ip
|
host, _, _ := net.SplitHostPort(ip)
|
||||||
|
return host
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue