Resolves: #83755
Releases: master, 8.7, 7.6
Change-Id: I6e13133f221137c63283ec1575fc405a38668b1a
Reviewed-on: https://review.typo3.org/58582
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Reviewed-by: Johannes Kasberger <johannes.kasberger@reelworx.at>
Tested-by: Johannes Kasberger <johannes.kasberger@reelworx.at>
Reviewed-by: Tomas Norre Mikkelsen <tomasnorre@gmail.com>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
if ($isOutputting) {
$response->getBody()->write($controller->content);
+ // if any code set a response code that is not 200 clear the cache's content
+ // if we fail to do so we would deliver cache content with a wrong header, which causes big mess.
+ if (http_response_code() !== 200 || $response->getStatusCode() !== 200) {
+ $controller->clearPageCacheContent();
+ }
}
return $isOutputting ? $response : new NullResponse();