Skip to content

Commit b1020a1

Browse files
author
yangchenzhuo
committed
fix: Custom Guzzle/Client Configuration Has Been Overwritten
1 parent 83c728c commit b1020a1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Transport/Adapter/Guzzle.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
namespace Elastic\Elasticsearch\Transport\Adapter;
1616

1717
use Elastic\Elasticsearch\Transport\RequestOptions;
18+
use GuzzleHttp\Client;
1819
use GuzzleHttp\RequestOptions As GuzzleOptions;
1920
use Psr\Http\Client\ClientInterface;
2021

@@ -38,7 +39,10 @@ public function setConfig(ClientInterface $client, array $config, array $clientO
3839
$guzzleConfig[GuzzleOptions::VERIFY] = $value;
3940
}
4041
}
42+
/** @var Client $client */
43+
$clientOptions = array_merge($clientOptions, $client->getConfig());
4144
$class = get_class($client);
45+
4246
return new $class(array_merge($clientOptions, $guzzleConfig));
4347
}
4448
}

0 commit comments

Comments
 (0)