summaryrefslogtreecommitdiff
path: root/sapi/cli/tests
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2014-08-01 11:17:13 +0200
committerOndřej Surý <ondrej@sury.org>2014-08-01 11:17:13 +0200
commitb60f6e95a473d1ae97fdf20cec4cfefc06b24ec2 (patch)
treee92e8d3c102992bc63eae4327d3498e7203a9168 /sapi/cli/tests
parent09ed144817606a3a835391b12455e6d9cb3a0ae2 (diff)
downloadphp-b60f6e95a473d1ae97fdf20cec4cfefc06b24ec2.tar.gz
New upstream version 5.6.0~rc3+dfsgupstream/5.6.0_rc3+dfsg
Diffstat (limited to 'sapi/cli/tests')
-rw-r--r--sapi/cli/tests/bug66830.phpt43
1 files changed, 43 insertions, 0 deletions
diff --git a/sapi/cli/tests/bug66830.phpt b/sapi/cli/tests/bug66830.phpt
new file mode 100644
index 000000000..58c07e031
--- /dev/null
+++ b/sapi/cli/tests/bug66830.phpt
@@ -0,0 +1,43 @@
+--TEST--
+Bug #66830 (Empty header causes PHP built-in web server to hang)
+--SKIPIF--
+<?php
+include "skipif.inc";
+?>
+--FILE--
+<?php
+include "php_cli_server.inc";
+php_cli_server_start(<<<'PHP'
+header(' ');
+PHP
+);
+
+list($host, $port) = explode(':', PHP_CLI_SERVER_ADDRESS);
+$port = intval($port)?:80;
+
+$fp = fsockopen($host, $port, $errno, $errstr, 0.5);
+if (!$fp) {
+ die("connect failed");
+}
+
+if(fwrite($fp, <<<HEADER
+GET / HTTP/1.1
+Host: {$host}
+
+
+HEADER
+)) {
+ while (!feof($fp)) {
+ echo fgets($fp);
+ }
+}
+
+fclose($fp);
+?>
+--EXPECTF--
+HTTP/1.1 200 OK
+Host: %s
+Connection: close
+X-Powered-By: %s
+Content-type: text/html; charset=UTF-8
+