From 28a808031b0b858d7de26c5c8aa3b1c686188845 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 29 Oct 2023 03:06:10 -0600 Subject: [PATCH] Update ApiV1Dot1Controller, allow iar rate limits to be configurable --- app/Http/Controllers/Api/ApiV1Dot1Controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/ApiV1Dot1Controller.php b/app/Http/Controllers/Api/ApiV1Dot1Controller.php index 6ed047af9..f63d69177 100644 --- a/app/Http/Controllers/Api/ApiV1Dot1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Dot1Controller.php @@ -470,7 +470,7 @@ class ApiV1Dot1Controller extends Controller abort_if(BouncerService::checkIp($request->ip()), 404); } - $rl = RateLimiter::attempt('pf:apiv1.1:iar:'.$request->ip(), 3, function(){}, 1800); + $rl = RateLimiter::attempt('pf:apiv1.1:iar:'.$request->ip(), config('pixelfed.app_registration_rate_limit_attempts', 3), function(){}, config('pixelfed.app_registration_rate_limit_decay', 1800)); abort_if(!$rl, 400, 'Too many requests'); $this->validate($request, [