Update: 2026-07-22 00:52:19
This commit is contained in:
@@ -30,6 +30,10 @@ class RateLimiter
|
|||||||
// $type: login | otp | api | ride | upload
|
// $type: login | otp | api | ride | upload
|
||||||
public function check(string $identifier, string $type = 'api'): bool
|
public function check(string $identifier, string $type = 'api'): bool
|
||||||
{
|
{
|
||||||
|
if (getenv('DISABLE_RATE_LIMITER') === 'true' || ($_ENV['DISABLE_RATE_LIMITER'] ?? '') === 'true') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (!$this->redis) {
|
if (!$this->redis) {
|
||||||
// HIGH-01 FIX: fallback مع ملف بدلاً من تمرير كل الطلبات
|
// HIGH-01 FIX: fallback مع ملف بدلاً من تمرير كل الطلبات
|
||||||
return $this->fileBasedCheck($identifier, $type);
|
return $this->fileBasedCheck($identifier, $type);
|
||||||
|
|||||||
Reference in New Issue
Block a user