Update: 2026-07-22 01:04:56
This commit is contained in:
@@ -56,6 +56,10 @@ class RateLimiter
|
||||
// ── تطبيق الحد وإيقاف الطلب إن تجاوز ─────────────────────
|
||||
public function enforce(string $identifier, string $type = 'api'): void
|
||||
{
|
||||
if (getenv('DISABLE_RATE_LIMITER') === 'true' || ($_ENV['DISABLE_RATE_LIMITER'] ?? '') === 'true') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$this->check($identifier, $type)) {
|
||||
$limit = self::LIMITS[$type] ?? self::LIMITS['api'];
|
||||
$window = $limit['window'];
|
||||
|
||||
Reference in New Issue
Block a user