Skip to content

Commit 37d814b

Browse files
committed
Add test XFAIL for bug #70470
1 parent 059dd18 commit 37d814b

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

sapi/cli/tests/bug70470.phpt

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
--TEST--
2+
Bug #70470 (Built-in server truncates headers spanning over TCP packets)
3+
--SKIPIF--
4+
<?php
5+
include "skipif.inc";
6+
?>
7+
--XFAIL--
8+
bug is not fixed yet
9+
--FILE--
10+
<?php
11+
include "php_cli_server.inc";
12+
php_cli_server_start("var_dump(getAllheaders());");
13+
14+
$fp = fsockopen(PHP_CLI_SERVER_HOSTNAME, PHP_CLI_SERVER_PORT, $errno, $errmsg, 0.5);
15+
16+
if (!$fp) {
17+
die("connect failed: " . $errmsg);
18+
}
19+
20+
fwrite($fp, "GET / HTTP/1.1\r\n");
21+
fwrite($fp, "Host: " . PHP_CLI_SERVER_HOSTNAME . "\r\n");
22+
fwrite($fp, "Content");
23+
fwrite($fp, "-Type: text/html; charset=UTF-8\r\n");
24+
fwrite($fp, "Connection: clo");
25+
fwrite($fp, "se\r\n\r\n");
26+
while (!feof($fp)) {
27+
echo fgets($fp);
28+
}
29+
fclose($fp);
30+
?>
31+
--EXPECTF--
32+
HTTP/1.1 200 OK
33+
%a
34+
array(3) {
35+
["Host"]=>
36+
string(9) "localhost"
37+
["Content-Type"]=>
38+
string(24) "text/html; charset=UTF-8"
39+
["Connection"]=>
40+
string(5) "close"
41+
}

0 commit comments

Comments
 (0)