Possible null pointer dereference in php_http_url_mod() fixed.
[m6w6/ext-http] / tests / bug69357.phpt
1 --TEST--
2 Bug #69357 (HTTP/1.1 100 Continue overriding subsequent 200 response code with PUT request)
3 --SKIPIF--
4 <?php
5 include "skipif.inc";
6 skip_client_test();
7 ?>
8 --FILE--
9 <?php
10 echo "Test\n";
11
12 include "helper/server.inc";
13
14 server("upload.inc", function($port) {
15 $r = new \http\Client\Request("PUT", "http://localhost:$port/", [],
16 (new \http\Message\Body)->append("foo")
17 );
18 $c = new \http\Client;
19 $c->setOptions(["expect_100_timeout" => 0]);
20 $c->enqueue($r)->send();
21
22 var_dump($c->getResponse($r)->getInfo());
23 var_dump($c->getResponse($r)->getHeaders());
24 });
25
26 ?>
27 ===DONE===
28 --EXPECTF--
29 Test
30 string(15) "HTTP/1.1 200 OK"
31 array(4) {
32 ["Accept-Ranges"]=>
33 string(5) "bytes"
34 ["Etag"]=>
35 string(10) ""%x""
36 ["X-Original-Transfer-Encoding"]=>
37 string(7) "chunked"
38 ["Content-Length"]=>
39 int(%d)
40 }
41 ===DONE===