diff --git a/src/Transport/Curl.php b/src/Transport/Curl.php index 289d9b15b..9a9f03f93 100644 --- a/src/Transport/Curl.php +++ b/src/Transport/Curl.php @@ -25,6 +25,7 @@ final class Curl implements Transport { const CURL_7_10_5 = 0x070A05; const CURL_7_16_2 = 0x071002; + const CURL_7_22_0 = 0x071600; /** * Raw HTTP data @@ -363,7 +364,7 @@ private function setup_handle($url, $headers, $data, $options) { $options['hooks']->dispatch('curl.before_request', [&$this->handle]); // Force closing the connection for old versions of cURL (<7.22). - if (!isset($headers['Connection'])) { + if ($this->version < self::CURL_7_22_0 && !isset($headers['Connection'])) { $headers['Connection'] = 'close'; }