Browse Source

Do not try to split ip and port of x-forwarded-for addresses

pull/231/head
Gabe Kangas 5 years ago
parent
commit
a7d9e2719a
  1. 2
      utils/clientId.go

2
utils/clientId.go

@ -28,7 +28,7 @@ func GetIPAddressFromRequest(req *http.Request) string { @@ -28,7 +28,7 @@ func GetIPAddressFromRequest(req *http.Request) string {
ipAddressString := req.RemoteAddr
xForwardedFor := req.Header.Get("X-FORWARDED-FOR")
if xForwardedFor != "" {
ipAddressString = xForwardedFor
return xForwardedFor
}
ip, _, err := net.SplitHostPort(ipAddressString)

Loading…
Cancel
Save