From b753f6af365cc9f12e96dbcb47b02e3ca9cd320d Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Sun, 21 Sep 2025 18:01:39 +0200 Subject: [PATCH] fix: handle no HTTP_USER_AGENT information for $_SERVER when running through occ console.php loads the provider to collect with IRequest even though we have no user-agent information, so let's fallback to an empty string Signed-off-by: Thomas Citharel --- lib/DataCollector/HttpDataCollector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/DataCollector/HttpDataCollector.php b/lib/DataCollector/HttpDataCollector.php index 7cee4e8f..4fbbcf25 100644 --- a/lib/DataCollector/HttpDataCollector.php +++ b/lib/DataCollector/HttpDataCollector.php @@ -32,7 +32,7 @@ public function collect(Request $request, Response $response, ?\Throwable $excep 'method' => $request->getMethod(), 'content' => $content, 'httpProtocol' => $request->getHttpProtocol(), - 'userAgent' => $_SERVER['HTTP_USER_AGENT'], + 'userAgent' => $_SERVER['HTTP_USER_AGENT'] ?? '', 'params' => $content, ], 'response' => [