1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-12 14:12:44 +01:00

Rate limiter for 404's

This commit is contained in:
David Bomba 2023-05-17 09:55:43 +10:00
parent 4e8c603d3a
commit 446fb59b5b
3 changed files with 10 additions and 2 deletions

View File

@ -32,7 +32,7 @@ class QueryLogging
* @return mixed
*/
public function handle(Request $request, Closure $next)
{
{nlog("yoyo");
// Enable query logging for development
if (! Ninja::isHosted() || ! config('beacon.enabled')) {
return $next($request);

View File

@ -78,6 +78,14 @@ class RouteServiceProvider extends ServiceProvider
}
});
RateLimiter::for('404', function (Request $request) {
if (Ninja::isSelfHost()) {
return Limit::none();
} else {
return Limit::perMinute(25)->by($request->ip());
}
});
}
/**

View File

@ -158,4 +158,4 @@ Route::fallback(function () {
abort(404);
});
})->middleware('throttle:404');