From f296d19832b080dd55419cafaef73cb23b20f56b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Thu, 29 Aug 2024 10:06:20 +0200 Subject: [PATCH] fix(Image): Do not send empty Content-Type header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- lib/private/Image.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/private/Image.php b/lib/private/Image.php index ca5058e6c65e5..396246125604f 100644 --- a/lib/private/Image.php +++ b/lib/private/Image.php @@ -166,7 +166,9 @@ public function show(?string $mimeType = null): bool { if ($mimeType === null) { $mimeType = $this->mimeType(); } - header('Content-Type: ' . ($mimeType ?? '')); + if ($mimeType !== null) { + header('Content-Type: ' . $mimeType); + } return $this->_output(null, $mimeType); }