Created
October 11, 2016 21:03
-
-
Save IMSoP/b893785c9c8f04c2b5ce3b0a638b33a7 to your computer and use it in GitHub Desktop.
/ext/standard/tests/http/bug-73297.phpt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--TEST-- | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment