Issue Bug Closed

#65719FE content-length header set too early

Christian Kuhn 03/13/15, 13:51 updated 10/02/18, 11:45

Description

With 6.2, sending content-length header was enabled by default via config.enableContentLengthHeader considered as “on”.

This is done in TSFE->processOutput. Unfortunately, there are a couple of things calculated after this header length is set – and some of those tend to change the output and thus its length afterward. Most prominently the eofe hook. If so, the content length will is set to a wrong value and some webservers or proxies stumble upon that – eg. varnish is a bit picky if header length and actual length differ.

Maybe possible solution: Move the header sending out of processOutput to a later point in TSFE processing – maybe directly before the echo out? That would be more clean and all the “disable if debug and disable if beUserLogin” and all this stuff would be obsolete.

Reviews 2