Include our user agent

This commit is contained in:
Graham Campbell
2016-05-29 19:17:22 +01:00
parent aa87274378
commit fb75ad6902
2 changed files with 2 additions and 2 deletions

View File

@@ -60,7 +60,7 @@ class Credits
{
return $this->cache->remember('version', 2880, function () {
return json_decode((new Client())->get($this->url, [
'headers' => ['Accept' => 'application/json'],
'headers' => ['Accept' => 'application/json', 'User-Agent' => defined('CACHET_VERSION') ? 'cachet/'.constant('CACHET_VERSION') : 'cachet'],
])->getBody(), true);
});
}

View File

@@ -68,7 +68,7 @@ class Releases
public function latest()
{
$release = $this->cache->remember('version', 720, function () {
$headers = ['Accept' => 'application/vnd.github.v3+json'];
$headers = ['Accept' => 'application/vnd.github.v3+json', 'User-Agent' => defined('CACHET_VERSION') ? 'cachet/'.constant('CACHET_VERSION') : 'cachet'];
if ($this->token) {
$headers['OAUTH-TOKEN'] = $this->token;