Skip to content

Commit

Permalink
Connection::getHandler() - removed calling Psr7/Client::setUserAgent(…
Browse files Browse the repository at this point in the history
…) call and replaced with config"
  • Loading branch information
SilverFire committed Jun 7, 2016
1 parent 13340a1 commit 0ee1eee
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ public function init()
if (!$this->config['base_uri']) {
throw new InvalidConfigException('The `base_uri` config option must be set');
}

if (!isset($this->config['headers']['User-Agent'])) {
$this->config['headers']['User-Agent'] = 'HiArt/0.x';
}
}

/**
Expand Down Expand Up @@ -306,7 +310,6 @@ public function getHandler()
{
if (static::$_handler === null) {
static::$_handler = new Handler($this->config);
static::$_handler->setUserAgent('hiart/0.x');
}

return static::$_handler;
Expand Down

0 comments on commit 0ee1eee

Please sign in to comment.