diff --git a/src/Request.php b/src/Request.php index 543690a1..503cf325 100755 --- a/src/Request.php +++ b/src/Request.php @@ -146,7 +146,8 @@ public function getServer(string $key, $default = null) */ public function getIP(): string { - return $this->getServer('HTTP_X_FORWARDED_FOR', $this->getServer('REMOTE_ADDR', '0.0.0.0')); + $ips = explode(',',$this->getHeader('HTTP_X_FORWARDED_FOR', $this->getServer('REMOTE_ADDR', '0.0.0.0'))); + return trim($ips[0] ?? ''); } /**