diff --git a/main.go b/main.go index e59037e..9dc3a3f 100644 --- a/main.go +++ b/main.go @@ -80,11 +80,8 @@ func getIPCountry(ip string) string { func handleRequest(w http.ResponseWriter, r *http.Request) { sourceIP := func() string { - if ip := r.Header.Get("CF-Connecting-IP"); ip != "" { - return ip - } if ip := r.Header.Get("X-Forwarded-For"); ip != "" { - return ip + return strings.Split(ip, ",")[0] } return strings.Split(r.RemoteAddr, ":")[0] }()