fix #47
[m6w6/ext-http] / tests / helper / upload.inc
1 <?php
2
3 include "dump.inc";
4 include "server.inc";
5
6 serve(function($client) {
7 $request = new http\Message($client, false);
8
9 if ($request->getHeader("Expect") === "100-continue") {
10 $response = new http\Env\Response;
11 $response->setEnvRequest($request);
12 $response->setResponseCode(100);
13 $response->send($client);
14 }
15
16 /* return the initial message as response body */
17 $response = new http\Env\Response;
18 /* avoid OOM with $response->getBody()->append($request); */
19 dump_message($response->getBody()->getResource(), $request);
20 $response->send($client);
21 });