Преглед изворни кода

Don't use MeekProxyForwardedForHeaders when value doesn't resolve

Rod Hynes пре 9 година
родитељ
комит
b582682e77
1 измењених фајлова са 3 додато и 1 уклоњено
  1. 3 1
      psiphon/server/meek.go

+ 3 - 1
psiphon/server/meek.go

@@ -329,7 +329,9 @@ func (server *MeekServer) getSession(
 				// list of IPs (each proxy in a chain). The first IP should be
 				// list of IPs (each proxy in a chain). The first IP should be
 				// the client IP.
 				// the client IP.
 				proxyClientIP := strings.Split(value, ",")[0]
 				proxyClientIP := strings.Split(value, ",")[0]
-				if net.ParseIP(proxyClientIP) != nil {
+				if net.ParseIP(proxyClientIP) != nil &&
+					server.support.GeoIPService.Lookup(proxyClientIP).Country != GEOIP_UNKNOWN_VALUE {
+
 					clientIP = proxyClientIP
 					clientIP = proxyClientIP
 					break
 					break
 				}
 				}