diff --git a/Classes/Middleware/CleanHtmlMiddleware.php b/Classes/Middleware/CleanHtmlMiddleware.php
index 95a1fb2..7dd4824 100644
--- a/Classes/Middleware/CleanHtmlMiddleware.php
+++ b/Classes/Middleware/CleanHtmlMiddleware.php
@@ -7,6 +7,7 @@
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;
+use TYPO3\CMS\Core\Http\Stream;
use TYPO3\CMS\Core\Utility\GeneralUtility;
class CleanHtmlMiddleware implements MiddlewareInterface
@@ -42,7 +43,10 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
$GLOBALS['TSFE']->config['config']['sourceopt.']
);
- // @todo replace old body with $processedHtml
+ // Replace old body with $processedHtml
+ $responseBody = new Stream('php://temp', 'rw');
+ $responseBody->write($processedHtml);
+ $response = $response->withBody($responseBody);
}
return $response;