Skip to content

Commit 5169215

Browse files
committed
Correcting bug in "SessionClient::listSessions()"
1 parent d33b92b commit 5169215

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

src/HttpRequest.php

+17-6
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,23 @@ public function setWriteOptions(WriteOptions $writeOptions = null)
132132
*/
133133
public function execute()
134134
{
135-
$this->url = sprintf(
136-
'%s/%s?%s',
137-
$this->_Config->compileAddress(),
138-
ltrim(trim($this->path), "/"),
139-
$this->params
140-
);
135+
if (0 === count($this->params))
136+
{
137+
$this->url = sprintf(
138+
'%s/%s',
139+
$this->_Config->compileAddress(),
140+
ltrim(trim($this->path), "/")
141+
);
142+
}
143+
else
144+
{
145+
$this->url = sprintf(
146+
'%s/%s?%s',
147+
$this->_Config->compileAddress(),
148+
ltrim(trim($this->path), "/"),
149+
$this->params
150+
);
151+
}
141152

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

src/Session/SessionClient.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ public function node($node, QueryOptions $queryOptions = null)
257257
*/
258258
public function listSessions(QueryOptions $queryOptions = null)
259259
{
260-
$r = new HttpRequest('get', 'v1/sesion/list', $this->_Config);
260+
$r = new HttpRequest('get', 'v1/session/list', $this->_Config);
261261
$r->setQueryOptions($queryOptions);
262262

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

0 commit comments

Comments
 (0)