Skip to content

Commit

Permalink
fix: ipapi pro not authorized (#44)
Browse files Browse the repository at this point in the history
* fix: ipapi pro not authorized

* Apply fixes from StyleCI

---------

Co-authored-by: StyleCI Bot <[email protected]>
  • Loading branch information
imorland and StyleCIBot authored Sep 12, 2024
1 parent b3d7c2a commit de4535c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/Api/Services/IPApiPro.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

class IPApiPro extends IPApi
{
protected $host = 'https://ip-api.com';
protected $host = 'https://pro.ip-api.com';
protected $settingPrefix = 'fof-geoip.services.ipapi-pro';

protected function requiresApiKey(): bool
Expand All @@ -25,4 +25,16 @@ public function isRateLimited(): bool
{
return false;
}

protected function buildUrl(string $ip, ?string $apiKey): string
{
return "/json/{$ip}?".http_build_query(['key' => $apiKey]);
}

protected function buildBatchUrl(array $ips, ?string $apiKey): string
{
$url = '/batch?'.http_build_query(['key' => $apiKey, 'fields' => $this->r2]);

return $url;
}
}

0 comments on commit de4535c

Please sign in to comment.