Bug #73841 [Opn->Ver]: ob_gzhandler() doesn't fully implement HTTP spec

From: Date: Wed, 14 Feb 2018 16:36:58 +0000
Subject: Bug #73841 [Opn->Ver]: ob_gzhandler() doesn't fully implement HTTP spec
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-213956@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73841&edit=1 ID: 73841 Updated by: cmb@php.net Reported by: giovanni at giacobbi dot net Summary: ob_gzhandler() doesn't fully implement HTTP spec -Status: Open +Status: Verified Type: Bug -Package: *Compression related +Package: Output Control Operating System: Any PHP Version: Irrelevant Block user comment: N Private report: N New Comment: See <https://tools.ietf.org/html/rfc7231#section-5.3.4>. Previous Comments: ------------------------------------------------------------------------ [2016-12-29 23:58:14] giovanni at giacobbi dot net Description: ------------ HTTP spec describes Accept-Encoding as a list with "quality values", i.e. it can be something like: Accept-Encoding: gzip;q=1.0, deflate;q=0.7 There is a special case when q equals zero which means the client does NOT accept that particular value Because the ob_gzhandler() is implemented with a strstr(Z_STRVAL_P(enc), "gzip"), the check fails to exclude "gzip;q=0" Test script: --------------- <?php ob_start("ob_gzhandler"); echo "Hello"; ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=73841&edit=1

« previous php.bugs (#213956) next »