|
@@ -5,9 +5,16 @@ import (
|
|
"encoding/csv"
|
|
"encoding/csv"
|
|
"io"
|
|
"io"
|
|
"net"
|
|
"net"
|
|
|
|
+ "strings"
|
|
)
|
|
)
|
|
|
|
|
|
func (s *Store) search(ip string) string {
|
|
func (s *Store) search(ip string) string {
|
|
|
|
+ if strings.Contains(ip, ",") {
|
|
|
|
+ //This is a CF proxied request. We only need the front part
|
|
|
|
+ //Example 219.71.102.145, 172.71.139.178
|
|
|
|
+ ip = strings.Split(ip, ",")[0]
|
|
|
|
+ ip = strings.TrimSpace(ip)
|
|
|
|
+ }
|
|
//See if there are cached country code for this ip
|
|
//See if there are cached country code for this ip
|
|
ccc, ok := s.geoipCache.Load(ip)
|
|
ccc, ok := s.geoipCache.Load(ip)
|
|
if ok {
|
|
if ok {
|