From de4535c5a43ed1c3587d470866c23d856525c841 Mon Sep 17 00:00:00 2001 From: IanM <16573496+imorland@users.noreply.github.com> Date: Thu, 12 Sep 2024 13:37:17 +0100 Subject: [PATCH] fix: ipapi pro not authorized (#44) * fix: ipapi pro not authorized * Apply fixes from StyleCI --------- Co-authored-by: StyleCI Bot --- src/Api/Services/IPApiPro.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Api/Services/IPApiPro.php b/src/Api/Services/IPApiPro.php index 3f024db..e738022 100644 --- a/src/Api/Services/IPApiPro.php +++ b/src/Api/Services/IPApiPro.php @@ -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 @@ -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; + } }