Skip to content

Commit

Permalink
fix: prevent get requests from being limited
Browse files Browse the repository at this point in the history
  • Loading branch information
ScuffedNewt committed Jul 8, 2024
1 parent 293e683 commit 3406942
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/Http/Middleware/PostRequestThrottleMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ class PostRequestThrottleMiddleware
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
*/
public function handle(Request $request, Closure $next): Response {
if ($request->isMethod('get')) {
return $next($request);
}

$key = $request->user()?->id ?: $request->ip();
$maxAttempts = 1;
$decaySeconds = 10;
Expand Down

0 comments on commit 3406942

Please sign in to comment.