Skip to content

Commit b658c38

Browse files
committed
feat: implement config for newClient
Signed-off-by: Sean Molenaar <sean@seanmolenaar.eu>
1 parent 5d7a02b commit b658c38

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

lib/private/Http/Client/ClientService.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function __construct(
3939
) {
4040
}
4141

42-
public function newClient(): IClient {
42+
public function newClient(array $baseConfig = []): IClient {
4343
$handler = new CurlHandler();
4444
$stack = HandlerStack::create($handler);
4545
if ($this->config->getSystemValueBool('dns_pinning', true)) {
@@ -51,7 +51,8 @@ public function newClient(): IClient {
5151
$this->eventLogger->end('http:request');
5252
}), 'event logger');
5353

54-
$client = new GuzzleClient(['handler' => $stack]);
54+
$config = array_merge($baseConfig, ['handler' => $stack]);
55+
$client = new GuzzleClient($config);
5556

5657
return new Client(
5758
$this->config,

lib/public/Http/Client/IClientService.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
* @since 8.1.0
1515
*/
1616
interface IClientService {
17-
/**
18-
* @param array $baseConfig default configuration for the client
17+
18+
/**
19+
* @param array $baseConfig default configuration for the client
1920
* @return IClient
2021
* @since 8.1.0
2122
*/

0 commit comments

Comments
 (0)