diff options
-rw-r--r-- | php-src/PSR7Client.php | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/php-src/PSR7Client.php b/php-src/PSR7Client.php index dc0070a9..e8d93fe8 100644 --- a/php-src/PSR7Client.php +++ b/php-src/PSR7Client.php @@ -107,7 +107,7 @@ class PSR7Client ])); } - /** + /** * Returns altered copy of _SERVER variable. Sets ip-address, * request-time and other values. * @@ -119,10 +119,7 @@ class PSR7Client $server = $_SERVER; $server['REQUEST_TIME'] = time(); $server['REQUEST_TIME_FLOAT'] = microtime(true); - - if (!empty($ctx['remoteAddr'])) { - $server['REMOTE_ADDR'] = $ctx['remoteAddr']; - } + $server['REMOTE_ADDR'] = $ctx['attributes']['ipAddress'] ?? $ctx['remoteAddr'] ?? '127.0.0.1'; return $server; } |