bug70470.phpt 782 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. --TEST--
  2. Bug #70470 (Built-in server truncates headers spanning over TCP packets)
  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. $fp = php_cli_server_connect();
  12. fwrite($fp, "GET / HTTP/1.1\r\n");
  13. fwrite($fp, "Host: " . PHP_CLI_SERVER_HOSTNAME . "\r\n");
  14. fwrite($fp, "Content");
  15. fflush($fp);
  16. usleep(200000);
  17. fwrite($fp, "-Type: text/html; charset=UTF-8\r\n");
  18. fwrite($fp, "Connection: clo");
  19. fflush($fp);
  20. usleep(200000);
  21. fwrite($fp, "se\r\n\r\n");
  22. while (!feof($fp)) {
  23. echo fgets($fp);
  24. }
  25. fclose($fp);
  26. ?>
  27. --EXPECTF--
  28. HTTP/1.1 200 OK
  29. %a
  30. array(3) {
  31. ["Host"]=>
  32. string(9) "localhost"
  33. ["Content-Type"]=>
  34. string(24) "text/html; charset=UTF-8"
  35. ["Connection"]=>
  36. string(5) "close"
  37. }