Skip to content

Commit

Permalink
Merge 55ee692 into 4c52352
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Jul 27, 2018
2 parents 4c52352 + 55ee692 commit f5bd92f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/BaseRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,14 @@ public function getCurlOptions()
$curlOpts[CURLOPT_CAINFO] = $this->cafile;
}

// feature detect http2 support in the php client/curl version.
if (defined('CURL_VERSION_HTTP2') && defined('CURL_HTTP_VERSION_2_0')) {
$curlVersion = curl_version();
if ($curlVersion["features"] & CURL_VERSION_HTTP2 !== 0) {
$curlOpts[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_2_0;
}
}

return $curlOpts;
}

Expand Down

0 comments on commit f5bd92f

Please sign in to comment.