File:
[ELWIX - Embedded LightWeight unIX -] /
embedaddon /
php /
sapi /
cli /
tests /
php_cli_server_006.phpt
Revision
1.1.1.1 (vendor branch):
download - view:
text,
annotated -
select for diffs -
revision graph
Tue May 29 12:34:35 2012 UTC (12 years, 3 months ago) by
misho
Branches:
php,
MAIN
CVS tags:
v5_4_3elwix,
v5_4_29p0,
v5_4_29,
v5_4_20p0,
v5_4_20,
v5_4_17p0,
v5_4_17,
HEAD
php 5.4.3+patches
1: --TEST--
2: Bug #55755 (SegFault when outputting header WWW-Authenticate)
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($_SERVER["PHP_AUTH_USER"], $_SERVER["PHP_AUTH_PW"]);');
11:
12: list($host, $port) = explode(':', PHP_CLI_SERVER_ADDRESS);
13: $port = intval($port)?:80;
14:
15: $fp = fsockopen($host, $port, $errno, $errstr, 0.5);
16: if (!$fp) {
17: die("connect failed");
18: }
19:
20: if(fwrite($fp, <<<HEADER
21: GET / HTTP/1.1
22: Host: {$host}
23: Authorization: Basic Zm9vOmJhcg==
24:
25:
26: HEADER
27: )) {
28: while (!feof($fp)) {
29: echo fgets($fp);
30: }
31: }
32:
33: ?>
34: --EXPECTF--
35: HTTP/1.1 200 OK
36: Host: %s
37: Connection: close
38: X-Powered-By: PHP/%s
39: Content-type: text/html
40:
41: string(3) "foo"
42: string(3) "bar"
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>