Bug #51269 [NEW]: zlib.output_compression Overwrites Vary Header

From: Date: Thu, 11 Mar 2010 01:17:31 +0000
Subject: Bug #51269 [NEW]: zlib.output_compression Overwrites Vary Header
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-148497@lists.php.net to get a copy of this message
From:             
Operating system: Linux
PHP version:      5.3.2
Package:          Zlib Related
Bug Type:         Bug
Bug description:zlib.output_compression Overwrites Vary Header

Description:
------------
We have an application which requires Vary: Cookie for its caching scheme
to work correctly. It's using the header() function to set the header
during the request. With PHP 5.2.9/Apache requesting a page with both
Accept-Encoding: gzip and without will correctly append Accept-Encoding to
the Vary:

--
HEAD / HTTP/1.1
Host: www.easports.com
        
HTTP/1.1 200 OK
Date: Thu, 11 Mar 2010 01:06:33 GMT
Vary: Cookie,Accept-Encoding
--

--
HEAD / HTTP/1.1
Host: www.easports.com
Accept-Encoding: gzip

HTTP/1.1 200 OK
Date: Thu, 11 Mar 2010 01:07:37 GMT
Vary: Cookie,Accept-Encoding
Content-Encoding: gzip
--

With PHP 5.3.2 the Vary header is overwritten when the content is served as
gzip:

---
HEAD / HTTP/1.1
Host: devsonet.dev.easports.ea.com

HTTP/1.1 200 OK
Date: Thu, 11 Mar 2010 01:10:00 GMT
Vary: Cookie,Accept-Encoding
--

--
HEAD / HTTP/1.1
Host: devsonet.dev.easports.ea.com
Accept-Encoding: gzip

HTTP/1.1 200 OK
Date: Thu, 11 Mar 2010 01:10:53 GMT
Vary: Accept-Encoding
Content-Encoding: gzip
--

The attached diff will make the application work as expected. This was
based on reverting a chunk that had changed between PHP 5.2.9 and PHP
5.2.13. This diff was clearly put in there to fix another bug so it's *not*
intended to be applied; it's just for demonstration purposes 



-- 
Edit bug report at http://bugs.php.net/bug.php?id=51269&edit=1
-- 
Try a snapshot (PHP 5.2):            http://bugs.php.net/fix.php?id=51269&r=trysnapshot52
Try a snapshot (PHP 5.3):            http://bugs.php.net/fix.php?id=51269&r=trysnapshot53
Try a snapshot (PHP 6.0):            http://bugs.php.net/fix.php?id=51269&r=trysnapshot60
Fixed in SVN:                        http://bugs.php.net/fix.php?id=51269&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51269&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=51269&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=51269&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=51269&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=51269&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=51269&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=51269&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=51269&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=51269&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=51269&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=51269&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=51269&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=51269&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=51269&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=51269&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=51269&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=51269&r=mysqlcfg



Thread (3 messages)

« previous php.bugs (#148497) next »