Skip to content

Commit 7832925

Browse files
authored
Http adapter curl missing delete method
Fix static tests & use strict comparison
1 parent a409774 commit 7832925

File tree

1 file changed

+4
-5
lines changed
  • lib/internal/Magento/Framework/HTTP/Adapter

1 file changed

+4
-5
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,22 +166,21 @@ public function write($method, $url, $http_ver = '1.1', $headers = [], $body = '
166166
// set url to post to
167167
curl_setopt($this->_getResource(), CURLOPT_URL, $url);
168168
curl_setopt($this->_getResource(), CURLOPT_RETURNTRANSFER, true);
169-
if ($method == \Zend_Http_Client::POST) {
169+
if ($method === \Zend_Http_Client::POST) {
170170
curl_setopt($this->_getResource(), CURLOPT_POST, true);
171171
curl_setopt($this->_getResource(), CURLOPT_CUSTOMREQUEST, 'POST');
172172
curl_setopt($this->_getResource(), CURLOPT_POSTFIELDS, $body);
173-
} elseif ($method == \Zend_Http_Client::PUT) {
173+
} elseif ($method === \Zend_Http_Client::PUT) {
174174
curl_setopt($this->_getResource(), CURLOPT_CUSTOMREQUEST, 'PUT');
175175
curl_setopt($this->_getResource(), CURLOPT_POSTFIELDS, $body);
176-
} elseif ($method == \Zend_Http_Client::GET) {
176+
} elseif ($method === \Zend_Http_Client::GET) {
177177
curl_setopt($this->_getResource(), CURLOPT_HTTPGET, true);
178178
curl_setopt($this->_getResource(), CURLOPT_CUSTOMREQUEST, 'GET');
179-
} elseif ($method == \Zend_Http_Client::DELETE) {
179+
} elseif ($method === \Zend_Http_Client::DELETE) {
180180
curl_setopt($this->_getResource(), CURLOPT_CUSTOMREQUEST, 'DELETE');
181181
curl_setopt($this->_getResource(), CURLOPT_POSTFIELDS, $body);
182182
}
183183

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

0 commit comments

Comments
 (0)