summaryrefslogtreecommitdiff
path: root/src/PSR7Client.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/PSR7Client.php')
-rw-r--r--src/PSR7Client.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/PSR7Client.php b/src/PSR7Client.php
index 129cb118..0b148884 100644
--- a/src/PSR7Client.php
+++ b/src/PSR7Client.php
@@ -144,7 +144,11 @@ class PSR7Client
$server['REQUEST_TIME_FLOAT'] = microtime(true);
$server['REMOTE_ADDR'] = $ctx['attributes']['ipAddress'] ?? $ctx['remoteAddr'] ?? '127.0.0.1';
$server['REMOTE_ADDR'] = $ctx['attributes']['ipAddress'] ?? $ctx['remoteAddr'] ?? '127.0.0.1';
- $server['HTTP_USER_AGENT'] = $ctx['headers']['User-Agent'][0] ?? '';
+
+ $server['HTTP_USER_AGENT'] = '';
+ if (isset($ctx['headers']['User-Agent'][0])) {
+ $server['HTTP_USER_AGENT'] = $ctx['headers']['User-Agent'][0];
+ }
return $server;
}