bug68745.phpt 548 B

123456789101112131415161718192021222324252627282930
  1. --TEST--
  2. Bug #68745 (Invalid HTTP requests make web server segfault)
  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(count($_SERVER));', 'not-index.php');
  11. $host = PHP_CLI_SERVER_HOSTNAME;
  12. $fp = php_cli_server_connect();
  13. if(fwrite($fp, "GET www.example.com:80 HTTP/1.1\r\n\r\n")) {
  14. while (!feof($fp)) {
  15. echo fgets($fp);
  16. }
  17. }
  18. fclose($fp);
  19. ?>
  20. --EXPECTF--
  21. HTTP/1.1 200 OK
  22. Date: %s
  23. Connection: close
  24. X-Powered-By: %s
  25. Content-type: text/html; charset=UTF-8
  26. int(%d)