Fixes broken API throttling

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2022-02-24 13:10:10 -08:00
parent a8028e7dd0
commit 50f55b4308
4 changed files with 13 additions and 3 deletions

View file

@ -153,4 +153,4 @@ IMPORT_TIME_LIMIT=600
IMPORT_MEMORY_LIMIT=500M
REPORT_TIME_LIMIT=12000
REQUIRE_SAML=false
API_THROTTLE_PER_MINUTE=120

View file

@ -45,7 +45,6 @@ class Kernel extends HttpKernel
],
'api' => [
'throttle:120,1',
'auth:api',
],
];

View file

@ -425,4 +425,15 @@ return [
],
/*
|--------------------------------------------------------------------------
| API Throttling
|--------------------------------------------------------------------------
|
| This value determines the number of API requests permitted per minute
|
*/
'api_throttle_per_minute' => env('API_THROTTLE_PER_MINUTE', 120),
];

View file

@ -14,7 +14,7 @@ use Illuminate\Http\Request;
*/
Route::group(['prefix' => 'v1','namespace' => 'Api', 'middleware' => 'auth:api'], function () {
Route::group(['prefix' => 'v1','namespace' => 'Api', 'middleware' => ['api', 'throttle:'.config('app.api_throttle_per_minute').',1']], function () {
Route::get('/', function() {