Skip to content

Commit efcb7e9

Browse files
author
Marton Farago
authored
Return response from named limiter (#34325)
If a named limiter returns a Response object, the `handleRequestUsingNamedLimiter` tried to return the unset variable `$limit`. Instead, it should return the actual response created by the named limiter.
1 parent 96ee350 commit efcb7e9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Illuminate/Routing/Middleware/ThrottleRequests.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ protected function handleRequestUsingNamedLimiter($request, Closure $next, $limi
8585
$limiterResponse = call_user_func($limiter, $request);
8686

8787
if ($limiterResponse instanceof Response) {
88-
return $limit;
88+
return $limiterResponse;
8989
} elseif ($limiterResponse instanceof Unlimited) {
9090
return $next($request);
9191
}

0 commit comments

Comments
 (0)