Bug #76100
closedDesign problem with sending of header "Content-Length"
100%
Description
Any extension registering a hook in TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_eofe']
may potentially totally break the output if config.enableContentLengthHeader = 1
(default since TYPO3 6.2) and no be user is logged in because the header "Content-Length" is then sent to the client and the length of the content is calculated in TSFE before the hooks are being called.
If the content is shortened, then the browser will wait until a timeout for extra content to be sent. If the content is made longer (e.g. in my case with an old version of EXT:solr trying to add extra JS plus 2 line breaks before the @</body>), the browser will truncate the output to the advertised length, resulting into a broken HTML to be interpreted.
(In my case) those 2 extra line breaks = 2 bytes made the end </html>
tag truncated to </htm
. Every browser except IE11 under Windows 10 (!) silently fixed it but IE11 under Windows 10 somehow remembered the extra payload l>
and prefixed it to the next asset fetched, most probably because of using pipelining with the connection. This resulted into a broken CSS and a non-branded intranet page in addition to a connection timeout of 15 seconds!
I don't know what to do here exactly but this is an extremely dangerous hook if the developer is not really aware of this issue.
Updated by Xavier Perseguers over 8 years ago
(just added references to tickets which were found by googling and very slowly led me to the actual problem in TYPO3 core so that others may have a chance to find this ticket as well)
Updated by Martin Kutschker over 8 years ago
Possible solutions:
- move the content length calulation after the hook
- disable the content length header if a hook is present
- recalculate the content length if a hook is present
Updated by Tymoteusz Motylewski over 7 years ago
- Related to Bug #65719: FE content-length header set too early added
Updated by Gerrit Code Review about 7 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54268
Updated by Gerrit Code Review about 7 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54268
Updated by Gerrit Code Review about 7 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54268
Updated by Gerrit Code Review about 7 years ago
Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54269
Updated by Benni Mack about 7 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset a7d63adc3b4d568dee86fe9267b1b069c089269f.