Commit a7d63adc authored by Benni Mack's avatar Benni Mack Committed by Markus Klein
Browse files

[BUGFIX] Set content-length header to the end of output

Resolves: #76100
Resolves: #65719
Releases: master, 8.7
Change-Id: I2e389dd6ecb497a164a457230f106a64373c1907
Reviewed-on: https://review.typo3.org/54268


Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Markus Klein's avatarMarkus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein's avatarMarkus Klein <markus.klein@typo3.org>
parent a8df3250
......@@ -3539,17 +3539,6 @@ class TypoScriptFrontendController implements LoggerAwareInterface
GeneralUtility::callUserFunction($_funcRef, $_params, $this);
}
}
// Send content-length header.
// Notice that all HTML content outside the length of the content-length header will be cut off!
// Therefore content of unknown length from included PHP-scripts and if admin users are logged
// in (admin panel might show...) or if debug mode is turned on, we disable it!
if (
(!isset($this->config['config']['enableContentLengthHeader']) || $this->config['config']['enableContentLengthHeader'])
&& !$this->beUserLogin && !$GLOBALS['TYPO3_CONF_VARS']['FE']['debug']
&& !$this->config['config']['debug'] && !$this->doWorkspacePreview()
) {
header('Content-Length: ' . strlen($this->content));
}
}
/**
......
......@@ -263,6 +263,17 @@ class RequestHandler implements RequestHandlerInterface
}
if ($sendTSFEContent) {
// Send content-length header.
// Notice that all HTML content outside the length of the content-length header will be cut off!
// Therefore content of unknown length from included PHP-scripts and if admin users are logged
// in (admin panel might show...) or if debug mode is turned on, we disable it!
if (
(!isset($this->controller->config['config']['enableContentLengthHeader']) || $this->controller->config['config']['enableContentLengthHeader'])
&& !$this->controller->beUserLogin && !$GLOBALS['TYPO3_CONF_VARS']['FE']['debug']
&& !$this->controller->config['config']['debug'] && !$this->controller->doWorkspacePreview()
) {
header('Content-Length: ' . strlen($this->controller->content));
}
$response->getBody()->write($this->controller->content);
}
GeneralUtility::makeInstance(LogManager::class)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment