mirror of
https://github.com/php/php-src.git
synced 2024-11-24 02:15:04 +08:00
Fixed bug #51269 (zlib.output_compression Overwrites Vary Header).
This commit is contained in:
parent
2c3b1fd920
commit
f60946eb54
1
NEWS
1
NEWS
@ -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,
|
||||
|
21
ext/zlib/tests/bug51269.phpt
Normal file
21
ext/zlib/tests/bug51269.phpt
Normal 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
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user