From f885d7292fb6a3f2037f5a92d750a171a212f1f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Tue, 24 Feb 2026 10:22:13 +0100 Subject: [PATCH] fix(occ): Do not attempt to send headers on CLI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This avoids errors like 'Cannot modify header information - headers already sent', when using --debug-log with occ. Signed-off-by: Côme Chilliet --- lib/base.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/base.php b/lib/base.php index 2884aaea9d539..fcc6fe700d02f 100644 --- a/lib/base.php +++ b/lib/base.php @@ -766,9 +766,10 @@ public static function init(): void { self::checkConfig(); self::checkInstalled($systemConfig); - self::addSecurityHeaders(); - - self::performSameSiteCookieProtection($config); + if (!self::$CLI) { + self::addSecurityHeaders(); + self::performSameSiteCookieProtection($config); + } if (!defined('OC_CONSOLE')) { $eventLogger->start('check_server', 'Run a few configuration checks');