From: Michael Wallner Date: Mon, 23 May 2016 15:49:04 +0000 (+0200) Subject: fix tests for libcurl >= 7.48 X-Git-Tag: RELEASE_2_6_0_BETA1~27 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=7633239fe5c44955e60b906b171b38afa8c3cb5d;p=m6w6%2Fext-http fix tests for libcurl >= 7.48 --- diff --git a/tests/client019.phpt b/tests/client019.phpt index c386a68..1e24ae8 100644 --- a/tests/client019.phpt +++ b/tests/client019.phpt @@ -44,7 +44,7 @@ Server on port %d CONNECT www.example.com:80 HTTP/1.1 Hello: there! Host: www.example.com:80 -Proxy-Connection: Keep-Alive -User-Agent: PECL_HTTP/%s PHP/%s libcurl/%s +%r(Proxy-Connection: Keep-Alive +)?%rUser-Agent: PECL_HTTP/%s PHP/%s libcurl/%s ===DONE=== diff --git a/tests/helper/proxy.inc b/tests/helper/proxy.inc index f99dd97..61a68bd 100644 --- a/tests/helper/proxy.inc +++ b/tests/helper/proxy.inc @@ -7,7 +7,9 @@ serve(function($client) { /* this might be a proxy connect or a standard request */ $request = new http\Message($client, false); - if ($request->getHeader("Proxy-Connection")) { + /* libcurl >= 7.48 does not send Proxy-Connection anymore */ + if ($request->getHeader("Proxy-Connection") + || $request->getRequestMethod() === "CONNECT") { $response = new http\Env\Response; $response->setEnvRequest($request); $response->send($client);