Skip to content

Commit

Permalink
Merge pull request #63 from mahadsprouttech/patch-1
Browse files Browse the repository at this point in the history
Fix calling curl_getinfo after curl_close() in sendRequest
  • Loading branch information
orhanerday authored Mar 4, 2023
2 parents c2d6505 + 8d0efc6 commit 196243f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/OpenAi.php
Original file line number Diff line number Diff line change
Expand Up @@ -513,11 +513,12 @@ private function sendRequest(string $url, string $method, array $opts = [])
$curl = curl_init();

curl_setopt_array($curl, $curl_info);
$response = curl_exec($curl);
curl_close($curl);
$response = curl_exec($curl);

$info = curl_getinfo($curl);
$this->curlInfo = $info;

curl_close($curl);

return $response;
}
Expand Down

0 comments on commit 196243f

Please sign in to comment.