Skip to content

Conversation

BenCavens
Copy link
Contributor

This is an improvement on the following PR that is already merged into 5.5.
#22619

The former PR made sure full URLs could be passed in the except array of the VerifyCsrfToken middleware. This PR adds wildcard support for full URLs as well. It is fully compatible with existing behaviour: both paths and full URLs can be added, with or without the * wildcard. e.g.

protected $except = [
    '/foo/bar',
    '/foo/*',
    'http://example.com/foo/bar', // Now possible to add full url with except matching
    'http://example.com/foo/*',   // or with wildcard
];

This PR contains tests on both the matching logic as well as for the request::fullUrlIs() method, which is used in the VerifyCsrfToken middleware.

@BenCavens BenCavens force-pushed the 5.5-improve-verify-csrf branch from e57b295 to c20ac9f Compare January 5, 2018 21:28
@taylorotwell taylorotwell merged commit 927c76e into laravel:5.5 Jan 5, 2018
@vlakoff
Copy link
Contributor

vlakoff commented Jan 5, 2018

I didn't notice there was a fullUrlIs() method, and you are even adding tests for it, that's fantastic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants