Skip to content

Conversation

@BrandonSurowiec
Copy link
Contributor

(This is a resubmission of #30336 by @tonysm.)

I needed to verify a relatively signed route and discovered the signed middleware that I normally reach for didn't support validating relative urls. This is now possible:

Route::get('foo')->middleware('signed:relative');

It helps to avoid writing checks like this in the controller:

public function index(Request $request)
{
    abort_unless($request->hasValidSignature($absolute = false), 403);

    //

I prefer to see what routes are signed in my routes/web.php file, not buried in the depths below.

@GrahamCampbell GrahamCampbell changed the title [8.x] Add relative URL support to ValidateSignature middleware. [8.x] Add relative URL support to ValidateSignature middleware Jun 7, 2020
@taylorotwell taylorotwell merged commit 598265b into laravel:master Jun 8, 2020
@BrandonSurowiec BrandonSurowiec deleted the signed-relative-middleware branch June 8, 2020 14:30
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.

2 participants