PHP  
 PHP_5_4
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for sapi/cli/tests/bug65633.phpt ('Bug #65633 (built-in server treat some http headers as case-sensitive)')

Script

1: <?php
2:
include "php_cli_server.inc";
3:
php_cli_server_start(<<<'PHP'
4:
var_dump($_COOKIE, $_SERVER['HTTP_FOO']);
5:
PHP
6: );
7:
8: list(
$host$port) = explode(':'PHP_CLI_SERVER_ADDRESS);
9:
$port intval($port)?:80;
10:
11:
$fp fsockopen($host$port$errno$errstr0.5);
12: if (!
$fp) {
13:   die(
"connect failed");
14: }
15:
16: if(
fwrite($fp, <<<HEADER
17:
GET / HTTP/1.1
18: cookie: foo=bar
19: foo: bar
20:
21:
22:
HEADER
23: )) {
24:     while (!
feof($fp)) {
25:         echo 
fgets($fp);
26:     }
27: }
28:
29:
fclose($fp);
30:
?>
31:

Expected

HTTP/1.1 200 OK
Connection: close
X-Powered-By: %s
Content-type: text/html

array(1) {
  ["foo"]=>
  string(3) "bar"
}
string(3) "bar"

Output

Warning: fsockopen(): unable to connect to localhost:8964 (Connection refused) in /var/php_gcov/PHP_5_4/sapi/cli/tests/bug65633.php on line 11
connect failed

Diff

001+ Warning: fsockopen(): unable to connect to localhost:8964 (Connection refused) in /var/php_gcov/PHP_5_4/sapi/cli/tests/bug65633.php on line 11
002+ connect failed
001- HTTP/1.1 200 OK
002- Connection: close
003- X-Powered-By: %s
004- Content-type: text/html
005- 
006- array(1) {
007-   ["foo"]=>
008-   string(3) "bar"
009- }
010- string(3) "bar"

 

Generated at Mon, 15 Dec 2014 17:02:57 +0000 (2 days ago)

Copyright © 2005-2014 The PHP Group
All rights reserved.