Skip to content

Commit

Permalink
Reset response headers after receiving response
Browse files Browse the repository at this point in the history
  • Loading branch information
kleiram committed Mar 9, 2021
1 parent 9f4d16e commit 2d00def
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,6 @@ public function sendRequest($endpoint, $params = [], $method = self::METHOD_GET,

$this->setPostData($curlSession, $method, $params);
$this->setSslVerification($curlSession);
$this->resetRawResponseHeaders();

$apiResult = curl_exec($curlSession);
$headerInfo = curl_getinfo($curlSession);
Expand All @@ -1083,6 +1082,7 @@ public function sendRequest($endpoint, $params = [], $method = self::METHOD_GET,

$apiResultJson = json_decode($apiResult, true);
$apiResultHeaders = $this->parseRawHeaders();
$this->resetRawHeaders();

$result = [];
$result['success'] = false;
Expand Down Expand Up @@ -1173,7 +1173,7 @@ protected function parseRawHeaders()
return $parsedHeaders;
}

protected function resetRawResponseHeaders()
protected function resetRawHeaders()
{
$this->rawResponseHeaders = [];
}
Expand Down

0 comments on commit 2d00def

Please sign in to comment.