Explorar o código

Fix handling of comma-separated Forwarded-For headers

Rod Hynes %!s(int64=3) %!d(string=hai) anos
pai
achega
3b2cfbcaf6
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      psiphon/server/meek.go

+ 3 - 0
psiphon/server/meek.go

@@ -674,6 +674,9 @@ func (server *MeekServer) getSessionOrEndpoint(
 				IPs := strings.Split(value, ",")
 				IP := IPs[len(IPs)-1]
 
+				// Remove optional whitespace surrounding the commas.
+				IP = strings.TrimSpace(IP)
+
 				if net.ParseIP(IP) != nil {
 					clientIP = IP
 					break