mirror of
https://github.com/php/php-src.git
synced 2024-09-23 02:47:26 +00:00
Add failing test for bug#73297
This commit is contained in:
parent
a67637039f
commit
4683377dfa
41
ext/standard/tests/http/bug73297.phpt
Normal file
41
ext/standard/tests/http/bug73297.phpt
Normal file
@ -0,0 +1,41 @@
|
||||
--TEST--
|
||||
Bug #73297 (Ignore 100 Continue returned by HTTP/1.1 servers)
|
||||
--INI--
|
||||
allow_url_fopen=1
|
||||
--SKIPIF--
|
||||
<?php require 'server.inc'; http_server_skipif('tcp://127.0.0.1:12342'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
require 'server.inc';
|
||||
|
||||
$ctx = stream_context_create();
|
||||
|
||||
function do_test() {
|
||||
$options = [
|
||||
'http' => [
|
||||
'protocol_version' => '1.1',
|
||||
'header' => 'Connection: Close'
|
||||
],
|
||||
];
|
||||
|
||||
$ctx = stream_context_create($options);
|
||||
|
||||
$responses = [
|
||||
"data://text/plain,HTTP/1.1 100 Continue\r\n\r\nHTTP/1.1 200 OK\r\n\r\n"
|
||||
. "Hello"
|
||||
];
|
||||
$pid = http_server('tcp://127.0.0.1:12342', $responses);
|
||||
|
||||
echo file_get_contents('http://127.0.0.1:12342/', false, $ctx);
|
||||
echo "\n";
|
||||
|
||||
http_server_kill($pid);
|
||||
}
|
||||
|
||||
do_test();
|
||||
echo "\n";
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Hello
|
||||
|
Loading…
Reference in New Issue
Block a user