Просмотр исходного кода

Update ApiV1Dot1Controller.php

Daniel Supernault 11 месяцев назад
Родитель
Сommit
2803861083
1 измененных файлов с 1 добавлено и 12 удалено
  1. 1 12
      app/Http/Controllers/Api/ApiV1Dot1Controller.php

+ 1 - 12
app/Http/Controllers/Api/ApiV1Dot1Controller.php

@@ -1128,15 +1128,6 @@ class ApiV1Dot1Controller extends Controller
         }
         }
         $user = $request->user();
         $user = $request->user();
 
 
-        $limitKey = 'compose:rate-limit:media-upload:'.$user->id;
-        $limitTtl = now()->addMinutes(15);
-        $limitReached = Cache::remember($limitKey, $limitTtl, function () use ($user) {
-            $dailyLimit = Media::whereUserId($user->id)->where('created_at', '>', now()->subDays(1))->count();
-
-            return $dailyLimit >= 1250;
-        });
-        abort_if($limitReached == true, 429);
-
         if ($user->has_roles) {
         if ($user->has_roles) {
             abort_if(! UserRoleService::can('can-post', $user->id), 403, 'Invalid permissions for this action');
             abort_if(! UserRoleService::can('can-post', $user->id), 403, 'Invalid permissions for this action');
         }
         }
@@ -1152,9 +1143,7 @@ class ApiV1Dot1Controller extends Controller
                 abort(403, 'Account size limit reached.');
                 abort(403, 'Account size limit reached.');
             }
             }
         }
         }
-
-        abort_if($limitReached == true, 429);
-
+        $limitKey = 'compose:rate-limit:media-upload:'.$user->id;
         $photo = $request->file('file');
         $photo = $request->file('file');
 
 
         $mimes = explode(',', config_cache('pixelfed.media_types'));
         $mimes = explode(',', config_cache('pixelfed.media_types'));