Skip to content

Commit

Permalink
Set User-Agent when calling VATSIM API
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonhasacat committed Feb 23, 2024
1 parent 75d2f1f commit 32826b3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/Classes/VATSIMApi2Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ private static function _key() {

private static function _client(): Client {
$key = VATSIMApi2Helper::_key();
return new Client(['base_uri' => self::_url(),'headers' => ['Authorization' => "Token {$key}"]]);
return new Client([
'base_uri' => self::_url(),
'headers' => ['Authorization' => "Token {$key}"],
'User-Agent' => 'VATUSA/current +https://vatusa.net',
]);
}
static function updateRating(int $cid, int $rating): bool {
$path = "/members/{$cid}";
Expand Down

0 comments on commit 32826b3

Please sign in to comment.