Skip to content

Commit

Permalink
Correcting bug in "SessionClient::listSessions()"
Browse files Browse the repository at this point in the history
  • Loading branch information
dcarbone committed Jul 21, 2016
1 parent d33b92b commit 5169215
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
23 changes: 17 additions & 6 deletions src/HttpRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,23 @@ public function setWriteOptions(WriteOptions $writeOptions = null)
*/
public function execute()
{
$this->url = sprintf(
'%s/%s?%s',
$this->_Config->compileAddress(),
ltrim(trim($this->path), "/"),
$this->params
);
if (0 === count($this->params))
{
$this->url = sprintf(
'%s/%s',
$this->_Config->compileAddress(),
ltrim(trim($this->path), "/")
);
}
else
{
$this->url = sprintf(
'%s/%s?%s',
$this->_Config->compileAddress(),
ltrim(trim($this->path), "/"),
$this->params
);
}

Logger::log('debug', 'Executing '.$this->method.' request '.$this->url.($this->body ? ' with body "'.$this->body.'"':''));

Expand Down
2 changes: 1 addition & 1 deletion src/Session/SessionClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public function node($node, QueryOptions $queryOptions = null)
*/
public function listSessions(QueryOptions $queryOptions = null)
{
$r = new HttpRequest('get', 'v1/sesion/list', $this->_Config);
$r = new HttpRequest('get', 'v1/session/list', $this->_Config);
$r->setQueryOptions($queryOptions);

list($duration, $response, $err) = $this->requireOK($this->doRequest($r));
Expand Down

0 comments on commit 5169215

Please sign in to comment.