-
Notifications
You must be signed in to change notification settings - Fork 11.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5.5] Fix: verify csrf token allows to except full urls #22619
Conversation
@@ -104,7 +104,7 @@ protected function inExceptArray($request) | |||
$except = trim($except, '/'); | |||
} | |||
|
|||
if ($request->is($except)) { | |||
if ($request->url() == $except || $request->is($except)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be ===
?
Would it need wildcards support as well? For consistency with the previously existing |
I believe this PR is missing tests. Could you add some? |
@BenCavens: Please add a test. I don't know what this PR does and can't add it the changelog. |
I'll try to add some tests. |
Can you please tell if wildcard support should be added? (I'd bend supposing it should be) Also, may I ask for a use case, where you have to use full urls instead of paths? |
@vlakoff @tillkruss I've created a new PR which adds the wildcard support as well as the necessary tests: #22661 I'm looking forward to your feedback. thx |
@BenCavens: Thanks, great work! |
Currently, you can leave out certain URLs from CSRF token verification by adding them to the
except
array. This is provided with an out-of-the-box laravel application.However, this only works if you add the paths and not the full URLs. This PR makes sure it is also possible to provide full URLs to this except array.