fix Content-Range messages; remove superfluous Content-Lenght:0 header
[m6w6/ext-http] / tests / client020.phpt
1 --TEST--
2 proxy - don't send proxy headers for a standard request
3 --SKIPIF--
4 <?php
5 include "skipif.inc";
6 skip_client_test();
7 ?>
8 --FILE--
9 <?php
10
11 include "helper/server.inc";
12
13 echo "Test\n";
14
15 server("proxy.inc", function($port, $stdin, $stdout, $stderr) {
16 echo "Server on port $port\n";
17 $c = new http\Client;
18 $r = new http\Client\Request("GET", "http://localhost:$port/");
19 $r->setOptions(array(
20 "timeout" => 3,
21 "proxyheader" => array("Hello" => "there!"),
22 ));
23 try {
24 $c->enqueue($r)->send();
25 } catch (Exception $e) {
26 echo $e;
27 }
28 echo $c->getResponse()->getBody();
29 unset($r, $client);
30 });
31
32 ?>
33 ===DONE===
34 --EXPECTF--
35 Test
36 Server on port %d
37 GET / HTTP/1.1
38 User-Agent: PECL_HTTP/%s PHP/%s libcurl/%s
39 Host: localhost:%d
40 Accept: */*
41 ===DONE===