From fb75ad6902766560a6201c569fd522f79932436f Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Sun, 29 May 2016 19:17:22 +0100 Subject: [PATCH] Include our user agent --- app/Integrations/Credits.php | 2 +- app/Integrations/Releases.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Integrations/Credits.php b/app/Integrations/Credits.php index 3bbd7332..4a65dab2 100644 --- a/app/Integrations/Credits.php +++ b/app/Integrations/Credits.php @@ -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); }); } diff --git a/app/Integrations/Releases.php b/app/Integrations/Releases.php index 3d0649b7..1c0ff64f 100644 --- a/app/Integrations/Releases.php +++ b/app/Integrations/Releases.php @@ -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;