[TYPO3-core] RFC: #11063: wrong content-length header breaks frontend in case of proxy-usage

Michael Stucki michael at typo3.org
Wed May 13 12:06:11 CEST 2009


Hi Georg,

I tested the fix and indeed it works. And I agree that it can still be 
improved lateron if there is a better solution. At least it won't break 
anymore now.

I've committed it to TYPO3_4-2 (@5409) and Trunk (@5407).

Thank you!

- michael

georg kuehnberger schrieb:
> This is a SVN patch request.
> 
> Type: bugfix
> 
> BT Reference: http://bugs.typo3.org/view.php?id=11063
> 
> Branches: trunk & elder
> 
> Problem:
> class.tslib_fe.php, function processOutput() calculates the 
> content-length wrongly in case of enabled debug. this leads proxies to 
> not deliver the complete page, but cut it off in the middle of nowhere.
> 
> Solution:
> In case debug is activated, TYPO3 should not send content-length at all; 
> proxies will behave nice then and deliver the complete page.
> 
> Patch provided: Simply added two more conditions to class.tslib_fe.php, 
> function processOutput()
> 
> Has patch: yes
> 
> regards georg
> 
> 
> Index: typo3/sysext/cms/tslib/class.tslib_fe.php
> ===================================================================
> --- typo3/sysext/cms/tslib/class.tslib_fe.php    (revision 5403)
> +++ typo3/sysext/cms/tslib/class.tslib_fe.php    (working copy)
> @@ -3342,8 +3342,15 @@
>              }
>          }
> 
> -            // Send content-lenght 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...) we disable it!
> -        if ($this->config['config']['enableContentLengthHeader'] && 
> !$this->isEXTincScript() && !$this->beUserLogin && 
> !$this->doWorkspacePreview())    {
> +            // Send content-lenght 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 ($this->config['config']['enableContentLengthHeader'] &&
> +            !$this->isEXTincScript() &&
> +            !$this->beUserLogin  &&
> +            !$this->TYPO3_CONF_VARS['FE']['debug'] &&
> +            !$this->config['config']['debug'] &&
> +            !$this->doWorkspacePreview()
> +        ) {
>              header('Content-Length: '.strlen($this->content));
>          }
>      }


-- 
Use a newsreader! Check out
http://typo3.org/community/mailing-lists/use-a-news-reader/


More information about the TYPO3-team-core mailing list