From 516921590367adf24b914fd5ba370740be453c9f Mon Sep 17 00:00:00 2001 From: Daniel Paul Carbone Date: Thu, 21 Jul 2016 07:53:40 -0500 Subject: [PATCH] Correcting bug in "SessionClient::listSessions()" --- src/HttpRequest.php | 23 +++++++++++++++++------ src/Session/SessionClient.php | 2 +- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/HttpRequest.php b/src/HttpRequest.php index 6c57487..3ef49b9 100644 --- a/src/HttpRequest.php +++ b/src/HttpRequest.php @@ -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.'"':'')); diff --git a/src/Session/SessionClient.php b/src/Session/SessionClient.php index 6f0aa9e..121e3aa 100644 --- a/src/Session/SessionClient.php +++ b/src/Session/SessionClient.php @@ -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));