Skip to content

Commit

Permalink
support custom gitlab installations with url like host/some/path/to/…
Browse files Browse the repository at this point in the history
…gitlab
  • Loading branch information
Ruslan Abelkharisov committed Oct 17, 2022
1 parent 651b0b2 commit bdf96e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Api/AbstractApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ abstract class AbstractApi
*
* @var string
*/
private const URI_PREFIX = 'api/v4/';
private const URI_PREFIX = '/api/v4/';

/**
* The client instance.
Expand Down
6 changes: 3 additions & 3 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
use Gitlab\HttpClient\Plugin\ExceptionThrower;
use Gitlab\HttpClient\Plugin\History;
use Http\Client\Common\HttpMethodsClientInterface;
use Http\Client\Common\Plugin\AddHostPlugin;
use Http\Client\Common\Plugin\BaseUriPlugin;
use Http\Client\Common\Plugin\HeaderDefaultsPlugin;
use Http\Client\Common\Plugin\HistoryPlugin;
use Http\Client\Common\Plugin\RedirectPlugin;
Expand Down Expand Up @@ -415,8 +415,8 @@ public function setUrl(string $url): void
{
$uri = $this->getHttpClientBuilder()->getUriFactory()->createUri($url);

$this->getHttpClientBuilder()->removePlugin(AddHostPlugin::class);
$this->getHttpClientBuilder()->addPlugin(new AddHostPlugin($uri));
$this->getHttpClientBuilder()->removePlugin(BaseUriPlugin::class);
$this->getHttpClientBuilder()->addPlugin(new BaseUriPlugin($uri));
}

/**
Expand Down

0 comments on commit bdf96e5

Please sign in to comment.