Skip to content

Commit 9a05033

Browse files
committed
Merge pull request #10918 from samdjstevens/5.1
[5.1] Fix issue where "/" route cannot be excluded from default CSRF token verification
2 parents 1e55c79 + e7dc0d4 commit 9a05033

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ public function handle($request, Closure $next)
6262
protected function shouldPassThrough($request)
6363
{
6464
foreach ($this->except as $except) {
65-
if ($request->is(trim($except, '/'))) {
65+
if ($except !== '/') {
66+
$except = trim($except, '/');
67+
}
68+
69+
if ($request->is($except)) {
6670
return true;
6771
}
6872
}

0 commit comments

Comments
 (0)