Skip to content

Commit 5d9b761

Browse files
committed
fix an error for parse response
1 parent bd250df commit 5d9b761

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/Curl/CurlClient.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@
6868
use const CURLOPT_PUT;
6969
use const CURLOPT_REFERER;
7070
use const CURLOPT_RETURNTRANSFER;
71-
use const CURLOPT_SAFE_UPLOAD;
7271
use const CURLOPT_SSL_VERIFYHOST;
7372
use const CURLOPT_SSL_VERIFYPEER;
7473
use const CURLOPT_SSLCERT;
@@ -338,7 +337,7 @@ public function request(string $url, $data = null, string $method = 'GET', array
338337
$this->setResponseParsed(true);
339338
} else {
340339
// if CURLOPT_HEADER is TRUE, The raw response data contains headers and body
341-
$this->rawResponse = (string)$response;
340+
$this->rawResponse = $response;
342341
$this->parseResponse(); // parse raw response data
343342
}
344343

src/Traits/ParseRawResponseTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ protected function parseResponse(): void
5353

5454
// Extract headers from response
5555
preg_match_all($pattern, $response, $matches);
56-
$headersString = array_pop($matches[0]);
56+
$headersString = (string)array_pop($matches[0]);
5757

5858
$headers = explode("\r\n", str_replace("\r\n\r\n", '', $headersString));
5959
// parse headers

0 commit comments

Comments
 (0)