Skip to content

Commit

Permalink
Remove normalizeBaseUri()
Browse files Browse the repository at this point in the history
  • Loading branch information
engram-design committed Dec 17, 2023
1 parent 41ce054 commit e7abab3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/clients/credentials/Generic.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function getCredentialsProviderConfig(): array
$url = App::parseEnv($this->url);

$config = array_filter([
'base_uri' => AuthUrlHelper::normalizeBaseUri($url),
'base_uri' => rtrim($url, '/'),
]);

if ($this->headers) {
Expand Down
5 changes: 4 additions & 1 deletion src/services/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ public function fetchRawData(array|string $clientOpts, string $method = '', stri
// Otherwise, we're probably passing in Guzzle settings for an in-template call
// Normalise the Base URI and URI
$uri = ltrim($uri, '/');
$clientOpts['base_uri'] = AuthUrlHelper::normalizeBaseUri(($clientOpts['base_uri'] ?? ''));

if (isset($clientOpts['base_uri'])) {
$clientOpts['base_uri'] = rtrim($clientOpts['base_uri'], '/');
}

$client = Craft::createGuzzleClient($clientOpts);
$response = $client->request($method, $uri, $options);
Expand Down

0 comments on commit e7abab3

Please sign in to comment.