From 9fa58cd361209a3a63f4dea5ca22dcbf6709054d Mon Sep 17 00:00:00 2001 From: Cedric Ziel Date: Mon, 5 Aug 2024 11:22:52 +0200 Subject: [PATCH] fix: apply plugins when providing a custom client --- src/Client.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Client.php b/src/Client.php index f1a3ef7..d483960 100644 --- a/src/Client.php +++ b/src/Client.php @@ -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; @@ -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); } }