Skip to content

Commit

Permalink
Fix access to private property cookies in HttpResponse class (#3)
Browse files Browse the repository at this point in the history
gomzyakov authored Jan 13, 2025
1 parent 02dfd20 commit 69472b7
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/Client/HttpResponse.php
Original file line number Diff line number Diff line change
@@ -71,6 +71,11 @@ function cookies()
return $this->cookies;
}

function setCookies($cookies): void
{
$this->cookies = $cookies;
}

function __toString()
{
return $this->body();
2 changes: 1 addition & 1 deletion src/Client/PendingHttpRequest.php
Original file line number Diff line number Diff line change
@@ -184,7 +184,7 @@ function send($method, $url, $options)
$this->transferStats = $transferStats;
}
], $options))), function($response) {
$response->cookies = $this->cookies;
$response->setCookies($this->cookies);
$response->transferStats = $this->transferStats;
});
} catch (ConnectException $e) {

0 comments on commit 69472b7

Please sign in to comment.