1
0
mirror of https://github.com/php/php-src.git synced 2026-04-26 01:18:19 +02:00
Files
archived-php-src/ext/standard/tests/http/bug80256.phpt
T
Nikita Popov 1c157d3fa2 Fixed bug #80256
Remove the transfer_encoding stream filter immediately when we
destroy the old stream, to make sure it doesn't get attached to
the new stream.
2020-10-20 15:35:41 +02:00

30 lines
672 B
PHP

--TEST--
Bug #80256: file_get_contents strip first line with chunked encoding redirect
--SKIPIF--
<?php require 'server.inc'; http_server_skipif(); ?>
--INI--
allow_url_fopen=1
--FILE--
<?php
require 'server.inc';
$responses = array(
"data://text/plain,HTTP/1.1 302 Moved Temporarily\r\n"
. "Location: /try-again\r\n"
. "Transfer-Encoding: chunked\r\n\r\n"
. "0\r\n\r\n",
"data://text/plain,HTTP/1.1 200 Ok\r\n"
. "Transfer-Encoding: chunked\r\n\r\n"
. "4\r\n1234\r\n0\r\n\r\n",
);
['pid' => $pid, 'uri' => $uri] = http_server($responses, $output);
var_dump(file_get_contents($uri));
http_server_kill($pid);
?>
--EXPECT--
string(4) "1234"