From c248f006e9bf80ee26d0c4eefb9f5a0119ba4267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCder?= Date: Sat, 17 Oct 2026 15:51:24 +0200 Subject: [PATCH] Added image/jpeg as API response --- Classes/Definition/ContentTypeDefinition.php | 2 ++ Classes/Middleware/MiddlewareApiAbstract.php | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/Classes/Definition/ContentTypeDefinition.php b/Classes/Definition/ContentTypeDefinition.php index 65404d3..2efa7c8 100644 --- a/Classes/Definition/ContentTypeDefinition.php +++ b/Classes/Definition/ContentTypeDefinition.php @@ -10,6 +10,8 @@ class ContentTypeDefinition { public const FILE_PLAIN = 'filePlain'; + public const IMAGE_JPEG = 'imageJpeg'; + public const JSON = 'json'; public const TEXT = 'text'; diff --git a/Classes/Middleware/MiddlewareApiAbstract.php b/Classes/Middleware/MiddlewareApiAbstract.php index a130c05..05c1ea3 100644 --- a/Classes/Middleware/MiddlewareApiAbstract.php +++ b/Classes/Middleware/MiddlewareApiAbstract.php @@ -178,6 +178,11 @@ public function createResponse(string $string, string $contentType = ContentType break; + case ContentTypeDefinition::IMAGE_JPEG: + $response = $response->withHeader('Content-Type', 'image/jpeg'); + + break; + case ContentTypeDefinition::XML: $response = $response->withHeader('Content-Type', 'application/xml; charset=utf-8');