diff --git a/lib/HttpClient/CurlClient.php b/lib/HttpClient/CurlClient.php index 6bc86e32b..13db222f6 100644 --- a/lib/HttpClient/CurlClient.php +++ b/lib/HttpClient/CurlClient.php @@ -22,6 +22,10 @@ } // @codingStandardsIgnoreEnd +if (!defined('CURL_HTTP_VERSION_2_0')) { + define('CURL_HTTP_VERSION_2_0', 3); +} + class CurlClient implements ClientInterface { private static $instance; @@ -193,6 +197,9 @@ public function request($method, $absUrl, $headers, $params, $hasFile) $opts[CURLOPT_SSL_VERIFYPEER] = false; } + // Enable HTTP/2, if supported + $opts[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_2_0; + list($rbody, $rcode) = $this->executeRequestWithRetries($opts, $absUrl); return [$rbody, $rcode, $rheaders];