diff --git a/api/frequent_ips.php b/api/frequent_ips.php index 82ed7aa..5010765 100644 --- a/api/frequent_ips.php +++ b/api/frequent_ips.php @@ -34,10 +34,18 @@ if (auth_enabled()) { $token_ok = false; if (TRIGGER_TOKEN !== '') { $provided = ''; + if (function_exists('apache_request_headers')) { + $requestHeaders = apache_request_headers(); + if (isset($requestHeaders['authorization'])) { + $authToken = $requestHeaders['authorization']; + $provided = substr($authToken, 7); + } + } $auth_header = $_SERVER['HTTP_AUTHORIZATION'] ?? ''; if (str_starts_with($auth_header, 'Bearer ')) { $provided = substr($auth_header, 7); } + if ($provided === '' && isset($_REQUEST['token'])) { $provided = $_REQUEST['token']; }