|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-10-11 22:13 UTC] felipe@php.net
-Status: Open
+Status: Assigned
-Assigned To:
+Assigned To: mike
[2011-10-13 09:10 UTC] mike@php.net
-Status: Assigned
+Status: Bogus
[2011-10-13 09:10 UTC] mike@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 08 11:00:01 2025 UTC |
Description: ------------ Calling ob_clean() after starting the ob_gzhandler screws up. ob_get_clean() doesn't seem to behave perfectly either. There seem to be two problems: * The gzip headers gets lost or is incorrect. * The Content-Encoding header can be set even if the data is not gzip'ed (See test script 2) Test script: --------------- <?php ob_start('ob_gzhandler'); // Do anything, doesn't matter whether you output anything or give an empty response. ob_clean(); ?> or <?php ob_start('ob_gzhandler'); echo "Hello world."; print ob_get_clean(); ?> Expected result: ---------------- HTTP/1.1 200 OK Date: Tue, 11 Oct 2011 14:32:12 GMT Server: Apache Content-Encoding: gzip Vary: Accept-Encoding Content-Length: 0 Connection: close Content-Type: text/html; charset=utf-8 Connection closed by foreign host. Actual result: -------------- HTTP/1.1 200 OK Date: Tue, 11 Oct 2011 14:32:12 GMT Server: Apache Content-Encoding: gzip Vary: Accept-Encoding Content-Length: 0 Connection: close Content-Type: text/html; charset=utf-8 [some data] Connection closed by foreign host.