From 05e9fbe76e55eb97f5dabc5f10f51000e59560b3 Mon Sep 17 00:00:00 2001 From: DAProgs Date: Mon, 16 Mar 2026 11:02:43 -0400 Subject: [PATCH] Fix auth bearer --- api/frequent_ips.php | 8 ++++++++ 1 file changed, 8 insertions(+) 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']; }