Bug #68778 [Opn->Ver]: zlib.output_compression does not parse Accept-Encoding correct
| From: | cmb@php.net | Date: | Tue, 22 Sep 2020 14:58:31 +0000 |
| Subject: | Bug #68778 [Opn->Ver]: zlib.output_compression does not parse Accept-Encoding correct | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-229142@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=68778&edit=1
ID: 68778
Updated by: cmb@php.net
Reported by: ingo dot flaschberger at openresearch dot com
Summary: zlib.output_compression does not parse
Accept-Encoding correct
-Status: Open
+Status: Verified
Type: Bug
Package: Zlib related
PHP Version: Irrelevant
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2015-01-09 14:07:55] ingo dot flaschberger at openresearch dot com
Description:
------------
In ext/zlib/zlib.c:static PHP_FUNCTION(ob_gzhandler)
the HTTP_ACCEPT_ENCODING is not parsed.
PHP only checks, if the string "gzip" oder "deflate" is inside the header and
enables outputcompression if set.
RFC2616 allows for example that a probability (q) is set, which could be also 0 (disable
compression) but PHP will enable it.
For example:
Accept-Encoding: gzip;q=0.0
actual result: compressed output
expected result: uncompressed output
Accept-Encoding: thisisnotavalidgzipacceptencoding
actual result: compressed output
expected result: uncompressed output
Test script:
---------------
<?php
ini_set("zlib.output_compression", "1");
ob_start();
echo "foo";
ob_get_clean();
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=68778&edit=1