xref: /PHP-8.3/sapi/cli/tests/bug65633.phpt (revision 13274912)
1--TEST--
2Bug #65633 (built-in server treat some http headers as case-sensitive)
3--SKIPIF--
4<?php
5include "skipif.inc";
6?>
7--FILE--
8<?php
9include "php_cli_server.inc";
10php_cli_server_start(<<<'PHP'
11var_dump($_COOKIE, $_SERVER['HTTP_FOO']);
12PHP
13);
14
15$host = PHP_CLI_SERVER_HOSTNAME;
16$fp = php_cli_server_connect();
17
18if(fwrite($fp, <<<HEADER
19GET / HTTP/1.1
20cookie: foo=bar
21foo: bar
22
23
24HEADER
25)) {
26    while (!feof($fp)) {
27        echo fgets($fp);
28    }
29}
30
31fclose($fp);
32?>
33--EXPECTF--
34HTTP/1.1 200 OK
35Date: %s
36Connection: close
37X-Powered-By: %s
38Content-type: text/html; charset=UTF-8
39
40array(1) {
41  ["foo"]=>
42  string(3) "bar"
43}
44string(3) "bar"
45