diff options
author | Adam Harvey <aharvey@php.net> | 2014-06-12 17:56:10 -0700 |
---|---|---|
committer | Adam Harvey <aharvey@php.net> | 2014-06-12 17:56:10 -0700 |
commit | e956ba935765c410195a3d402aa9456d187472d6 (patch) | |
tree | bf4217751f0257df809d84589fac82f170760cd4 /sapi/cli/tests | |
parent | aa3a5f7681060b9fe7839479d4b4355ccaa10e5e (diff) | |
parent | fe676748091e3329a8c8b053b7ce6fd41ae264e6 (diff) | |
download | php-git-e956ba935765c410195a3d402aa9456d187472d6.tar.gz |
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
Add 308 and 426 to the HTTP response code map in the CLI server.
Diffstat (limited to 'sapi/cli/tests')
-rw-r--r-- | sapi/cli/tests/bug67429.phpt | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/sapi/cli/tests/bug67429.phpt b/sapi/cli/tests/bug67429.phpt new file mode 100644 index 0000000000..59486dbc0e --- /dev/null +++ b/sapi/cli/tests/bug67429.phpt @@ -0,0 +1,49 @@ +--TEST-- +FR #67429 (CLI server is missing some new HTTP response codes) +--SKIPIF-- +<?php +include "skipif.inc"; +?> +--FILE-- +<?php +include "php_cli_server.inc"; + +foreach ([308, 426] as $code) { + php_cli_server_start(<<<PHP +http_response_code($code); +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 + + +HEADER + )) { + while (!feof($fp)) { + echo fgets($fp); + } + } + + fclose($fp); +} +?> +--EXPECTF-- +HTTP/1.1 308 Permanent Redirect +Connection: close +X-Powered-By: %s +Content-type: text/html + +HTTP/1.1 426 Upgrade Required +Connection: close +X-Powered-By: %s +Content-type: text/html + |