bug66830.phpt 541 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. --TEST--
  2. Bug #66830 (Empty header causes PHP built-in web server to hang)
  3. --SKIPIF--
  4. <?php
  5. include "skipif.inc";
  6. ?>
  7. --FILE--
  8. <?php
  9. include "php_cli_server.inc";
  10. php_cli_server_start(<<<'PHP'
  11. header(' ');
  12. PHP
  13. );
  14. $host = PHP_CLI_SERVER_HOSTNAME;
  15. $fp = php_cli_server_connect();
  16. if(fwrite($fp, <<<HEADER
  17. GET / HTTP/1.1
  18. Host: {$host}
  19. HEADER
  20. )) {
  21. while (!feof($fp)) {
  22. echo fgets($fp);
  23. }
  24. }
  25. fclose($fp);
  26. ?>
  27. --EXPECTF--
  28. HTTP/1.1 200 OK
  29. Host: %s
  30. Date: %s
  31. Connection: close
  32. X-Powered-By: %s
  33. Content-type: text/html; charset=UTF-8