From da0eb9b8e8020798edae0a0665864a276c1f6c30 Mon Sep 17 00:00:00 2001 From: Scott MacVicar Date: Tue, 24 Mar 2009 01:57:53 +0000 Subject: [PATCH] Fix bug #42362 - certain status codes never have output, so sending the gzip compression headers cause problems --- ext/zlib/zlib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 3b4073a62b..9c4c55695f 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -1034,7 +1034,7 @@ static void php_gzip_output_handler(char *output, uint output_len, char **handle { zend_bool do_start, do_end; - if (!ZLIBG(output_compression)) { + if (!ZLIBG(output_compression) || SG(sapi_headers).http_response_code == 204 || SG(sapi_headers).http_response_code == 304) { *handled_output = NULL; } else { do_start = (mode & PHP_OUTPUT_HANDLER_START ? 1 : 0); -- 2.40.0