Skip to content

Commit 5f5cead

Browse files
Merge pull request #16 from codelathe/bugfix/line_break_to_split_headers_and_body
Fixing the double quotes problem
2 parents 8acf44b + 09abdf2 commit 5f5cead

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

fccloudapi.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2590,7 +2590,7 @@ protected function afterRequestDebug(string $method, string $url, string $postDa
25902590
if ($this->debug) {
25912591

25922592
// normalize the line breaks
2593-
$result = str_replace('\r\n', '\n', trim($result));
2593+
$result = str_replace("\r\n", "\n", trim($result));
25942594

25952595
// request
25962596
$this->debugMessages['Request'] = "$method $url";
@@ -2600,8 +2600,8 @@ protected function afterRequestDebug(string $method, string $url, string $postDa
26002600

26012601
// request headers
26022602
$rawRequest = curl_getinfo($this->curl_handle, CURLINFO_HEADER_OUT);
2603-
$rawRequest = str_replace('\r\n', '\n', trim($rawRequest));
2604-
$lines = explode('\n', $rawRequest);
2603+
$rawRequest = str_replace("\r\n", "\n", trim($rawRequest));
2604+
$lines = explode("\n", $rawRequest);
26052605
array_shift($lines); // remove the first line and keep the headers
26062606
$headers = [];
26072607
foreach ($lines as $line) {
@@ -2623,8 +2623,8 @@ protected function afterRequestDebug(string $method, string $url, string $postDa
26232623
$this->debugMessages['Response Code'] = curl_getinfo($this->curl_handle, CURLINFO_HTTP_CODE);
26242624

26252625
// Response Headers and body
2626-
[$rawHeaders, $body] = explode('\n\n', $result);
2627-
$lines = explode('\n', trim($rawHeaders));
2626+
[$rawHeaders, $body] = explode("\n\n", $result, 2);
2627+
$lines = explode("\n", trim($rawHeaders));
26282628
array_shift($lines);
26292629
$headers = [];
26302630
foreach ($lines as $line) {

0 commit comments

Comments
 (0)