Skip to content

Commit

Permalink
Updated logic to convert to string for comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
tangix committed Jul 4, 2024
1 parent da57987 commit fd16faf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions system/HTTP/CURLRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -651,11 +651,12 @@ protected function setCURLOptions(array $curlOptions = [], array $config = [])

// version
if (! empty($config['version'])) {
if ($config['version'] === 1.0 || $config['version'] === '1.0') {
$version = sprintf('%.1f', $config['version']);
if ($version === '1.0') {
$curlOptions[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_0;
} elseif ($config['version'] === 1.1 || $config['version'] === '1.1') {
} elseif ($version === '1.1') {
$curlOptions[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_1;
} elseif ($config['version'] === 2.0 || $config['version'] === '2.0') {
} elseif ($version === '2.0') {
$curlOptions[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_2_0;
}
}
Expand Down

0 comments on commit fd16faf

Please sign in to comment.