Skip to content

Commit

Permalink
improved Connection::getBaseUri to add trailing slash if uri is domai…
Browse files Browse the repository at this point in the history
…n only
  • Loading branch information
hiqsol committed Jan 24, 2017
1 parent c648c01 commit d128a27
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/AbstractConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,21 @@ public function isError(ResponseInterface $response)
return false;
}

/**
* Return API base uri.
* Adds trailing slash if uri is domain only.
* @return string
*/
public function getBaseUri()
{
static $checked;
if (empty($checked)) {
if (count(explode('/', $this->baseUri, 4)) === 3) {
$this->baseUri .= '/';
}
$checked = true;
}

return $this->baseUri;
}

Expand Down

0 comments on commit d128a27

Please sign in to comment.