1--TEST--
2Bug #55758 (Digest Authenticate missed in 5.4)
3--SKIPIF--
4<?php
5include "skipif.inc";
6?>
7--FILE--
8<?php
9include "php_cli_server.inc";
10php_cli_server_start('header(\'WWW-Authenticate: Digest realm="foo",qop="auth",nonce="XXXXX",opaque="'.md5("foo").'"\');');
11
12$host = PHP_CLI_SERVER_HOSTNAME;
13$fp = php_cli_server_connect();
14
15if(fwrite($fp, <<<HEADER
16GET / HTTP/1.1
17Host: {$host}
18Authorization: Basic Zm9vOmJhcg==
19
20
21HEADER
22)) {
23	while (!feof($fp)) {
24		echo fgets($fp);
25	}
26}
27
28?>
29--EXPECTF--
30HTTP/1.1 401 Unauthorized
31Host: %s
32Date: %s
33Connection: close
34X-Powered-By: PHP/%s
35WWW-Authenticate: Digest realm="foo",qop="auth",nonce="XXXXX",opaque="acbd18db4cc2f85cedef654fccc4a4d8"
36Content-type: text/html; charset=UTF-8
37