Skip to content

Commit

Permalink
Prevents Stepping On When An Incoming Request Is Ajax
Browse files Browse the repository at this point in the history
  • Loading branch information
SupianIDz committed Aug 3, 2020
1 parent a7cb617 commit 1ce6546
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Http/Middleware/SudoMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ public function __construct(Sudo $sudo)
*/
public function handle($request, Closure $next)
{
if ($request->ajax() || ! $request->isMethod('GET')) {
return $next($request);
}

if (! $this->sudo->isEnabled() || $this->isExcepted($request)) {
return $next($request);
}
Expand Down

0 comments on commit 1ce6546

Please sign in to comment.