improve request stats

This commit is contained in:
Dennis Eichhorn 2023-09-18 23:30:21 +00:00
parent 61eb86ae6f
commit 0844846f51
2 changed files with 4 additions and 1 deletions

View File

@ -165,7 +165,7 @@ final class HttpHeader extends HeaderAbstract
if (\strpos($userAgent, 'Opera') !== false || \strpos($userAgent, 'OPR/') !== false) {
return 'Opera';
} elseif (\strpos($userAgent, 'Edge') !== false) {
} elseif (\strpos($userAgent, 'Edge') !== false || \strpos($userAgent, 'Edg/') !== false) {
return 'Microsoft Edge';
} elseif (\strpos($userAgent, 'Chrome') !== false) {
return 'Google Chrome';

View File

@ -46,6 +46,8 @@ class ImpressionStat
public string $userAgent = '';
public array $meta = [];
public function __construct(HttpRequest $request)
{
$this->language = $request->header->l11n->language;
@ -73,6 +75,7 @@ class ImpressionStat
'country' => $this->country,
'referer' => $this->referer,
'datetime' => $this->datetime->getTimestamp(),
'meta' => $this->meta,
];
}
}