From fcd6b89a43d8f8f8051189cb5243cb498b1a34b2 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 16 Nov 2019 06:59:09 +0100 Subject: [PATCH] Add header for current Firefly III version. --- app/Services/FireflyIIIOrg/Update/UpdateRequest.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/Services/FireflyIIIOrg/Update/UpdateRequest.php b/app/Services/FireflyIIIOrg/Update/UpdateRequest.php index 08dc85a6fb..0ff06430c2 100644 --- a/app/Services/FireflyIIIOrg/Update/UpdateRequest.php +++ b/app/Services/FireflyIIIOrg/Update/UpdateRequest.php @@ -45,8 +45,13 @@ class UpdateRequest implements UpdateRequestInterface $uri = config('firefly.update_endpoint'); Log::debug(sprintf('Going to call %s', $uri)); try { - $client = new Client(); - $res = $client->request('GET', $uri); + $client = new Client(); + $options = [ + 'headers' => [ + 'User-Agent' => sprintf('FireflyIII/%s', config('firefly.version')), + ], + ]; + $res = $client->request('GET', $uri, $options); } catch (GuzzleException|Exception $e) { throw new FireflyException(sprintf('Response error from update check: %s', $e->getMessage())); }