From d630d512aeefb3896b98ce6db74d74274853792f Mon Sep 17 00:00:00 2001 From: Sebastian Helzle Date: Sun, 16 May 2021 12:45:50 +0200 Subject: [PATCH] BUGFIX: Prevent empty response In cases of non html responses like the `/sitemap.xml` the content stream was retrieved but then the pointer of the stream is already at the end. This resulted in an empty broken response. --- Classes/Aspect/CollectDebugInformationAspect.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Classes/Aspect/CollectDebugInformationAspect.php b/Classes/Aspect/CollectDebugInformationAspect.php index 3bce945..b900621 100644 --- a/Classes/Aspect/CollectDebugInformationAspect.php +++ b/Classes/Aspect/CollectDebugInformationAspect.php @@ -110,6 +110,7 @@ public function addDebugValues(JoinPointInterface $joinPoint) if ($response instanceof Response) { $output = $response->getBody()->getContents(); + $response->getBody()->rewind(); if ($response->getHeader('Content-Type') !== 'text/html' && strpos($output, '') === false) {