diff --git a/application/controllers/Api.php b/application/controllers/Api.php index d8b5c7c5d..19fdfa021 100644 --- a/application/controllers/Api.php +++ b/application/controllers/Api.php @@ -42,6 +42,7 @@ class API extends CI_Controller { $result = $this->rate_limit->check($endpoint, $identifier); if (!$result['allowed']) { + log_message("Debug","Rate limit for ".$endpoint." and ID:".($identifier ?? '')." exceeded"); $this->rate_limit->send_limit_exceeded_response($result['retry_after']); return false; } diff --git a/application/libraries/Rate_limit.php b/application/libraries/Rate_limit.php index fef2d6bcf..8fcb64068 100644 --- a/application/libraries/Rate_limit.php +++ b/application/libraries/Rate_limit.php @@ -166,7 +166,6 @@ class Rate_limit { * @param int $retry_after Seconds until retry is allowed */ public function send_limit_exceeded_response($retry_after) { - log_message("Error","Rate limit exceeded"); http_response_code(429); header('Retry-After: ' . $retry_after); echo json_encode([