xref: /PHP-8.1/sapi/cli/tests/emptyheader.phpt (revision 13274912)
1--TEST--
2Correctly handle split and empty header
3--SKIPIF--
4<?php
5include "skipif.inc";
6?>
7--FILE--
8<?php
9include "php_cli_server.inc";
10php_cli_server_start("var_dump(getAllheaders());");
11
12$host = PHP_CLI_SERVER_HOSTNAME;
13$fp = php_cli_server_connect();
14
15fwrite($fp, "GET / HTTP/1.1\r\nUser-Agent\r\nAccept: */*\r\nReferer:\r\nHi\r\n\r\n");
16fflush($fp);
17while (!feof($fp)) {
18    echo fgets($fp);
19}
20fclose($fp);
21?>
22--EXPECTF--
23HTTP/1.1 200 OK
24%a
25array(3) {
26  ["User-AgentAccept"]=>
27  string(3) "*/*"
28  ["Referer"]=>
29  string(0) ""
30  ["Hi"]=>
31  string(0) ""
32}
33