Skip to content

Commit 2640250

Browse files
feat: make auth http client config extends from default client config (#2348)
Co-authored-by: Brent Shaffer <betterbrent@google.com>
1 parent b2624d2 commit 2640250

2 files changed

Lines changed: 2 additions & 13 deletions

File tree

src/AuthHandler/Guzzle6AuthHandler.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,6 @@ public function attachKey(ClientInterface $http, $key)
105105

106106
private function createAuthHttp(ClientInterface $http)
107107
{
108-
return new Client([
109-
'base_uri' => $http->getConfig('base_uri'),
110-
'http_errors' => true,
111-
'verify' => $http->getConfig('verify'),
112-
'proxy' => $http->getConfig('proxy'),
113-
]);
108+
return new Client(['http_errors' => true] + $http->getConfig());
114109
}
115110
}

tests/Google/ClientTest.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -997,14 +997,8 @@ public function testCredentialsOptionWithCredentialsLoader()
997997

998998
$httpClient = $this->prophesize('GuzzleHttp\ClientInterface');
999999
$httpClient->getConfig()
1000-
->shouldBeCalledOnce()
1000+
->shouldBeCalled()
10011001
->willReturn(['handler' => $handler->reveal()]);
1002-
$httpClient->getConfig('base_uri')
1003-
->shouldBeCalledOnce();
1004-
$httpClient->getConfig('verify')
1005-
->shouldBeCalledOnce();
1006-
$httpClient->getConfig('proxy')
1007-
->shouldBeCalledOnce();
10081002
$httpClient->send(Argument::any(), Argument::any())
10091003
->shouldNotBeCalled();
10101004

0 commit comments

Comments
 (0)