php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65391 Unable to send vary header user-agent when ob_start('ob_gzhandler') is called
Submitted: 2013-08-05 09:22 UTC Modified: 2013-08-09 22:53 UTC
From: nikcomestotalk at gmail dot com Assigned: mike
Status: Closed Package: Output Control
PHP Version: 5.4.17 OS: any
Private report: No CVE-ID:
 [2013-08-05 09:22 UTC] nikcomestotalk at gmail dot com
Description:
------------
ob_start('ob_gzhandler') is overwriting vary-header "Vary: User-
Agent,Accept,Accept-Encoding" to "Vary: Accept-Encoding"


Not using apache level gzip



Test script:
---------------
header("Vary: User-Agent,Accept,Accept-Encoding");
ob_start("ob_gzhandler");
ob_flush();


Client side response header
vary: Accept Encoding

Expected result:
----------------
Vary: User-Agent,Accept,Accept-Encoding

Actual result:
--------------
vary: Accept Encoding

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-08-06 04:50 UTC] yohgaki@php.net
-Package: zip +Package: Zlib related
 [2013-08-06 04:50 UTC] yohgaki@php.net
zlib module is the one writing Vary header.
 [2013-08-06 04:52 UTC] yohgaki@php.net
-Package: Zlib related +Package: Output Control
 [2013-08-06 04:52 UTC] yohgaki@php.net
Reclassified as output control issue, since this is output issue.
 [2013-08-06 04:57 UTC] yohgaki@php.net
-Status: Open +Status: Feedback
 [2013-08-06 04:57 UTC] yohgaki@php.net
Oops, you have

header("Vary: User-Agent,Accept,Accept-Encoding");
ob_start("ob_gzhandler");
ob_flush();

Change it to 

ob_start("ob_gzhandler");
header("Vary: User-Agent,Accept,Accept-Encoding");
ob_flush();

Then it should work. If it works, please close this bug. If not, please reopen.
 [2013-08-06 05:26 UTC] yohgaki@php.net
-Status: Feedback +Status: Verified
 [2013-08-06 05:26 UTC] yohgaki@php.net
[yohgaki@dev PHP-5.4]$ ./sapi/cgi/php-cgi 
<?php
ob_start("ob_gzhandler");
header("Vary: User-Agent,Accept,Accept-Encoding");
ob_flush();


X-Powered-By: PHP/5.4.19-dev
Vary: Accept-Encoding
Content-type: text/html
 [2013-08-06 06:52 UTC] nikcomestotalk at gmail dot com
Not yet fixed, still getting "Vary: Accept-Encoding" only


But working fine on version 5.3.2 and 5.2[Checked on my other server having this 
version on php]
 [2013-08-09 08:32 UTC] mike@php.net
Yasuo, are you already fixing this, or shall I?
 [2013-08-09 09:00 UTC] mike@php.net
-Assigned To: +Assigned To: mike
 [2013-08-09 09:26 UTC] mike@php.net
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src.git;a=commit;h=5cea7a9047ca45c99b107a89d833c2d0dbe96ec8
Log: fix bug #65391
 [2013-08-09 09:26 UTC] mike@php.net
-Status: Verified +Status: Closed
 [2013-08-09 09:27 UTC] mike@php.net
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src.git;a=commit;h=5cea7a9047ca45c99b107a89d833c2d0dbe96ec8
Log: fix bug #65391
 [2013-08-09 09:34 UTC] mike@php.net
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ac28283beb58b367ef1f842b5ee0d6397eb4b516
Log: fix bug #65391
 [2013-08-09 09:34 UTC] mike@php.net
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ac28283beb58b367ef1f842b5ee0d6397eb4b516
Log: fix bug #65391
 [2013-08-09 09:39 UTC] mike@php.net
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ac28283beb58b367ef1f842b5ee0d6397eb4b516
Log: fix bug #65391
 [2013-08-09 22:53 UTC] yohgaki@php.net
Thanks mike.
 [2013-11-17 09:30 UTC] laruence@php.net
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src.git;a=commit;h=5cea7a9047ca45c99b107a89d833c2d0dbe96ec8
Log: fix bug #65391
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sun Apr 20 20:02:01 2014 UTC