xref: /PHP-8.2/ext/standard/tests/http/bug80256.phpt (revision 1c157d3f)
1--TEST--
2Bug #80256: file_get_contents strip first line with chunked encoding redirect
3--SKIPIF--
4<?php require 'server.inc'; http_server_skipif(); ?>
5--INI--
6allow_url_fopen=1
7--FILE--
8<?php
9require 'server.inc';
10
11$responses = array(
12    "data://text/plain,HTTP/1.1 302 Moved Temporarily\r\n"
13    . "Location: /try-again\r\n"
14    . "Transfer-Encoding: chunked\r\n\r\n"
15    . "0\r\n\r\n",
16    "data://text/plain,HTTP/1.1 200 Ok\r\n"
17    . "Transfer-Encoding: chunked\r\n\r\n"
18    . "4\r\n1234\r\n0\r\n\r\n",
19);
20
21['pid' => $pid, 'uri' => $uri] = http_server($responses, $output);
22
23var_dump(file_get_contents($uri));
24
25http_server_kill($pid);
26
27?>
28--EXPECT--
29string(4) "1234"
30