Skip to content

Commit b1e4987

Browse files
ENGCOM-4424: Fixed curl adapter to properly set http version based on $http_ver argument #21549
- Merge Pull Request #21549 from davidalger/magento2:bugfix/curl-adapater-ignores-http-version - Merged commits: 1. b57dab0
2 parents e51df41 + b57dab0 commit b1e4987

File tree

1 file changed

+6
-0
lines changed
  • lib/internal/Magento/Framework/HTTP/Adapter

1 file changed

+6
-0
lines changed

lib/internal/Magento/Framework/HTTP/Adapter/Curl.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,12 @@ public function write($method, $url, $http_ver = '1.1', $headers = [], $body = '
183183
curl_setopt($this->_getResource(), CURLOPT_CUSTOMREQUEST, 'GET');
184184
}
185185

186+
if ($http_ver === \Zend_Http_Client::HTTP_1) {
187+
curl_setopt($this->_getResource(), CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
188+
} elseif ($http_ver === \Zend_Http_Client::HTTP_0) {
189+
curl_setopt($this->_getResource(), CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
190+
}
191+
186192
if (is_array($headers)) {
187193
curl_setopt($this->_getResource(), CURLOPT_HTTPHEADER, $headers);
188194
}

0 commit comments

Comments
 (0)