Skip to content

Commit

Permalink
Merge pull request #21 from AOEpeople/bugfix/missing-headers
Browse files Browse the repository at this point in the history
add missing headers, e.g. cache headers
  • Loading branch information
hacksch authored Mar 18, 2024
2 parents daf5d18 + 9280ca6 commit 2bf9af6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Classes/Middleware/ContentPostProcAll.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,14 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
return $response;
}

$header = $response->getHeaders();
$status = $response->getStatusCode();

try {
$this->setPageObject($GLOBALS['TSFE']);
$this->scrapeAndReplace();

// replace response content instead init new response doesn't work well in some cases -we must do some more testing
//$body = new Stream('php://temp', 'rw');
//$body->write($this->page->getPageObject()->content);
//$response->withBody($body);
$response = new HtmlResponse($this->page->getPageObject()->content);
$response = new HtmlResponse($this->page->getPageObject()->content, $status, $header);
} catch (Exception $exception) {
$this->logger
->logException(__METHOD__, $exception);
Expand Down

0 comments on commit 2bf9af6

Please sign in to comment.