Fixed bug #51269 (zlib.output_compression Overwrites Vary Header).

This commit is contained in:
Adam Harvey 2010-03-11 06:20:22 +00:00
parent 2c3b1fd920
commit f60946eb54
3 changed files with 23 additions and 1 deletions

1
NEWS
View File

@ -6,6 +6,7 @@ PHP NEWS
- Added stream filter support to mcrypt extension (ported from
mcrypt_filter). (Stas)
- Fixed bug #51269 (zlib.output_compression Overwrites Vary Header). (Adam)
- Fixed bug #51257 (CURL_VERSION_LARGEFILE incorrectly used after libcurl
version 7.10.1). (aron dot ujvari at microsec dot hu)
- Fixed bug #51242 (Empty mysql.default_port does not default to 3306 anymore,

View File

@ -0,0 +1,21 @@
--TEST--
Bug #51269 (zlib.output_compression Overwrites Vary Header)
--INI--
zlib.output_compression=1
--ENV--
HTTP_ACCEPT_ENCODING=gzip
--SKIPIF--
<?php
if (!extension_loaded("zlib")) die("skip zlib required");
?>
--FILE--
<?php
header('Vary: Cookie');
echo 'foo';
?>
--EXPECTF--
%s
--EXPECTHEADERS--
Vary: Cookie
Content-Encoding: gzip
Vary: Accept-Encoding

View File

@ -1056,7 +1056,7 @@ static void php_gzip_output_handler(char *output, uint output_len, char **handle
sapi_add_header_ex(ZEND_STRL("Content-Encoding: deflate"), 1, 1 TSRMLS_CC);
break;
}
sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 1 TSRMLS_CC);
sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 0 TSRMLS_CC);
} else {
/* Disable compression if headers can not be set (Fix for bug #49816) */
ZLIBG(output_compression) = 0;