emptyheader.phpt 558 B

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