xref: /PHP-7.2/ext/standard/tests/http/bug73297.phpt (revision 66ac73be)
1--TEST--
2Bug #73297 (Ignore 100 Continue returned by HTTP/1.1 servers)
3--INI--
4allow_url_fopen=1
5--SKIPIF--
6<?php require 'server.inc'; http_server_skipif('tcp://127.0.0.1:12342'); ?>
7--FILE--
8<?php
9require 'server.inc';
10
11$options = [
12  'http' => [
13    'protocol_version' => '1.1',
14    'header' => 'Connection: Close'
15  ],
16];
17
18$ctx = stream_context_create($options);
19
20$responses = [
21  "data://text/plain,HTTP/1.1 100 Continue\r\n\r\nHTTP/1.1 200 OK\r\n\r\n"
22    . "Hello"
23];
24$pid = http_server('tcp://127.0.0.1:12342', $responses);
25
26echo file_get_contents('http://127.0.0.1:12342/', false, $ctx);
27echo "\n";
28
29http_server_kill($pid);
30
31?>
32--EXPECT--
33Hello
34