]> granicus.if.org Git - php/commitdiff
Added support for --GZIP_POST-- and --DEFLATE_POST-- that allows emulation
authorIlia Alshanetsky <iliaa@php.net>
Mon, 7 May 2007 18:40:33 +0000 (18:40 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 7 May 2007 18:40:33 +0000 (18:40 +0000)
of compressed POST input

run-tests.php

index 38e4ed5545eaecbb0a8784d49c32f853bbd5d4ce..c6bf1fce2f30536430692c46164c21232a1707cd 100755 (executable)
@@ -1328,6 +1328,15 @@ TEST $file
        } elseif (array_key_exists('POST', $section_text) && !empty($section_text['POST'])) {
 
                $post = trim($section_text['POST']);
+
+               if (array_key_exists('GZIP_POST', $section_text) && function_exists('gzencode')) {
+                       $post = gzencode($post, 9, FORCE_GZIP);
+                       $env['HTTP_CONTENT_ENCODING'] = 'gzip';
+               } else if (array_key_exists('DEFLATE_POST', $section_text) && function_exists('gzcompress')) {
+                       $post = gzcompress($post, 9);
+                       $env['HTTP_CONTENT_ENCODING'] = 'deflate';
+               }
+
                save_text($tmp_post, $post);
                $content_length = strlen($post);