php-src/tests/basic/req44164.phpt
Gustavo André dos Santos Lopes 1f191e4d2b - Implemented request #44164, zlib.output_compression is now implicitly
disabled when the header "Content-length" is set.
#One could argue that any output handler could change the size of the
#response, so this exception for zlib.output_compression is an
#inconsistency. However, zlib.output_compression is presented as a
#performance setting, whose value should have no effect on the
#correctness of the scripts. This was not the case. Setting the
#header "content-length" and enabling zlib.output_compression was
#a recipe for infringing section 4.4 of RFC 2616.
2010-10-26 02:16:21 +00:00

18 lines
561 B
PHP

--TEST--
Req #44164 (Handle "Content-Length" HTTP header when zlib.output_compression active)
--SKIPIF--
<?php
if (!function_exists('gzdeflate'))
die("skip zlib extension required");
?>
--INI--
zlib.output_compression=On
--ENV--
HTTP_ACCEPT_ENCODING=gzip
--FILE--
<?php
header("Content-length: 200");
echo str_repeat("a", 200);
--EXPECT--
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa