Skip to content

Commit

Permalink
Merge pull request #16 from codelathe/bugfix/line_break_to_split_head…
Browse files Browse the repository at this point in the history
…ers_and_body

Fixing the double quotes problem
  • Loading branch information
jefersonralmeida authored May 8, 2019
2 parents 8acf44b + 09abdf2 commit 5f5cead
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions fccloudapi.php
Original file line number Diff line number Diff line change
Expand Up @@ -2590,7 +2590,7 @@ protected function afterRequestDebug(string $method, string $url, string $postDa
if ($this->debug) {

// normalize the line breaks
$result = str_replace('\r\n', '\n', trim($result));
$result = str_replace("\r\n", "\n", trim($result));

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

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

// Response Headers and body
[$rawHeaders, $body] = explode('\n\n', $result);
$lines = explode('\n', trim($rawHeaders));
[$rawHeaders, $body] = explode("\n\n", $result, 2);
$lines = explode("\n", trim($rawHeaders));
array_shift($lines);
$headers = [];
foreach ($lines as $line) {
Expand Down

0 comments on commit 5f5cead

Please sign in to comment.