Skip to content

Commit

Permalink
ENGCOM-4424: Fixed curl adapter to properly set http version based on…
Browse files Browse the repository at this point in the history
… $http_ver argument #21549
  • Loading branch information
sivaschenko authored Apr 28, 2019
2 parents 45e7e2f + b1e4987 commit 658acfa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/internal/Magento/Framework/HTTP/Adapter/Curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ public function write($method, $url, $http_ver = '1.1', $headers = [], $body = '
curl_setopt($this->_getResource(), CURLOPT_CUSTOMREQUEST, 'GET');
}

if ($http_ver === \Zend_Http_Client::HTTP_1) {
curl_setopt($this->_getResource(), CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
} elseif ($http_ver === \Zend_Http_Client::HTTP_0) {
curl_setopt($this->_getResource(), CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
}

if (is_array($headers)) {
curl_setopt($this->_getResource(), CURLOPT_HTTPHEADER, $headers);
}
Expand Down

0 comments on commit 658acfa

Please sign in to comment.