Skip to content

Commit

Permalink
only build default http handler if none is supplied
Browse files Browse the repository at this point in the history
  • Loading branch information
dwsupplee committed Mar 1, 2016
1 parent eca865b commit 1fefffd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/HttpRequestWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
use Google\Auth\HttpHandler\HttpHandlerFactory;
use GuzzleHttp\Psr7;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;

/**
* The HttpRequestWrapper is responsible for delivering and signing requests.
Expand Down Expand Up @@ -73,9 +74,8 @@ public function __construct(
callable $httpHandler = null,
callable $authHttpHandler = null
) {
$handler = HttpHandlerFactory::build();
$this->httpHandler = $httpHandler ?: $handler;
$this->authHttpHandler = $authHttpHandler ?: $handler;
$this->httpHandler = $httpHandler ?: HttpHandlerFactory::build();
$this->authHttpHandler = $authHttpHandler ?: $this->httpHandler;
$this->scopes = $scopes;

if ($keyFile || $keyFilePath) {
Expand All @@ -88,7 +88,7 @@ public function __construct(
*
* @param RequestInterface $request Psr7 request.
* @param array $options HTTP specific configuration options.
* @return RequestInterface
* @return ResponseInterface
*/
public function send(RequestInterface $request, array $options = [])
{
Expand Down

0 comments on commit 1fefffd

Please sign in to comment.