From 7633239fe5c44955e60b906b171b38afa8c3cb5d Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 23 May 2016 17:49:04 +0200 Subject: [PATCH] fix tests for libcurl >= 7.48 --- tests/client019.phpt | 4 ++-- tests/helper/proxy.inc | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) 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); -- 2.30.2