Skip to content

Commit 51cbf9b

Browse files
committedMar 22, 2019
🚿
1 parent 0ffc54b commit 51cbf9b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed
 

‎src/Psr18/CurlHandle.php

+4-5
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,9 @@ protected function initCurlHeaders(array $options):array{
200200
* @return resource cURL handle
201201
*/
202202
public function init(){
203-
$options = $this->initCurlOptions();
204-
203+
$options = $this->initCurlOptions();
205204
$userinfo = $this->request->getUri()->getUserInfo();
205+
$method = $this->request->getMethod();
206206

207207
if(!empty($userinfo)){
208208
$options[\CURLOPT_USERPWD] = $userinfo;
@@ -211,12 +211,11 @@ public function init(){
211211
/*
212212
* Some HTTP methods cannot have payload:
213213
*
214-
* - GET — cURL will automatically change method to PUT or POST
214+
* - GET — cURL will automatically change the method to PUT or POST
215215
* if we set CURLOPT_UPLOAD or CURLOPT_POSTFIELDS.
216-
* - HEAD — cURL treats HEAD as GET request with a same restrictions.
216+
* - HEAD — cURL treats HEAD as a GET request with same restrictions.
217217
* - TRACE — According to RFC7231: a client MUST NOT send a message body in a TRACE request.
218218
*/
219-
$method = $this->request->getMethod();
220219

221220
if(\in_array($method, ['DELETE', 'PATCH', 'POST', 'PUT'], true)){
222221
$this->setBodyOptions($options);

0 commit comments

Comments
 (0)