Skip to content

Commit

Permalink
fix: apply plugins when providing a custom client
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricziel committed Aug 5, 2024
1 parent 692d2d1 commit 9fa58cd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use CedricZiel\Baserow\Generated\Authentication\JWTAuthentication;
use CedricZiel\Baserow\Generated\Client as GeneratedClient;
use Http\Client\Common\Plugin\AddHostPlugin;
use Http\Client\Common\PluginClient;
use Jane\Component\OpenApiRuntime\Client\Plugin\AuthenticationRegistry;
use Nyholm\Psr7\Uri;

Expand Down Expand Up @@ -40,6 +41,10 @@ public static function createForUrl(

$plugins = array_merge($plugins, $additionalPlugins);

if ($httpClient) {
$httpClient = new PluginClient($httpClient, $plugins);
}

return parent::create($httpClient, $plugins, $additionalNormalizers);
}
}

0 comments on commit 9fa58cd

Please sign in to comment.