Skip to content

Commit

Permalink
Only construct Guzzle client if not set by something else
Browse files Browse the repository at this point in the history
  • Loading branch information
dcarbone committed May 10, 2017
1 parent c54eb76 commit 483a49a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ public function __construct(array $config = []) {
$c
));
}

// if client hasn't been constructed, construct.
if (null === $this->HttpClient) {
$this->HttpClient = new Client();
}
}

/**
Expand All @@ -150,7 +155,6 @@ private static function getDefaultConfig() {
$conf = [
'Address' => '127.0.0.1:8500',
'Scheme' => 'http',
'HttpClient' => new Client(),
];

// parse env vars
Expand Down

0 comments on commit 483a49a

Please sign in to comment.