Skip to content

Commit

Permalink
Merge pull request #20 from AOEpeople/bugfix/missing-cache-headers
Browse files Browse the repository at this point in the history
Replace response content instead init new response object
  • Loading branch information
hacksch authored Mar 11, 2024
2 parents 5e1daa1 + cc8ccb7 commit 9508138
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Classes/Middleware/ContentPostProcAll.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;
use TYPO3\CMS\Core\Http\HtmlResponse;
use TYPO3\CMS\Core\Http\Stream;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
use Exception;
Expand Down Expand Up @@ -43,7 +43,11 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
try {
$this->setPageObject($GLOBALS['TSFE']);
$this->scrapeAndReplace();
$response = new HtmlResponse($this->page->getPageObject()->content);

$body = new Stream('php://temp', 'rw');
$body->write($this->page->getPageObject()->content);

$response->withBody($body);
} catch (Exception $exception) {
$this->logger
->logException(__METHOD__, $exception);
Expand Down

0 comments on commit 9508138

Please sign in to comment.