فهرست منبع

Fix: validated wrong value

Rod Hynes 9 سال پیش
والد
کامیت
8ed83176bf
1فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 3 3
      psiphon/server/meek.go

+ 3 - 3
psiphon/server/meek.go

@@ -303,7 +303,7 @@ func (server *MeekServer) getSession(
 	}
 	}
 
 
 	// Determine the client remote address, which is used for geolocation
 	// Determine the client remote address, which is used for geolocation
-	// and stats. When an intermediate proxy of CDN is in use, we may be
+	// and stats. When an intermediate proxy or CDN is in use, we may be
 	// able to determine the original client address by inspecting HTTP
 	// able to determine the original client address by inspecting HTTP
 	// headers such as X-Forwarded-For.
 	// headers such as X-Forwarded-For.
 
 
@@ -317,7 +317,7 @@ 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(header, ",")[0]
 				proxyClientIP := strings.Split(header, ",")[0]
-				if net.ParseIP(clientIP) != nil {
+				if net.ParseIP(proxyClientIP) != nil {
 					clientIP = proxyClientIP
 					clientIP = proxyClientIP
 					break
 					break
 				}
 				}
@@ -331,7 +331,7 @@ func (server *MeekServer) getSession(
 	// meek conn with a useful value to return when the tunnel
 	// meek conn with a useful value to return when the tunnel
 	// server calls conn.RemoteAddr() to get the client's IP address.
 	// server calls conn.RemoteAddr() to get the client's IP address.
 
 
-	// Assumes clientIP is a value IP address; the port value is a stub
+	// Assumes clientIP is a valid IP address; the port value is a stub
 	// and is expected to be ignored.
 	// and is expected to be ignored.
 	clientConn := newMeekConn(
 	clientConn := newMeekConn(
 		&net.TCPAddr{
 		&net.TCPAddr{