Do not run CSRF middleware on JSON Accept header
This commit is contained in:
parent
1cdbec7d5e
commit
3416f731e7
|
@ -21,4 +21,13 @@ class VerifyCsrfToken extends Middleware
|
|||
protected $except = [
|
||||
//
|
||||
];
|
||||
|
||||
public function handle($request, \Closure $next)
|
||||
{
|
||||
if($request->format() == 'json') {
|
||||
return $next($request);
|
||||
} else {
|
||||
return parent::handle($request, $next);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue