laravel / framework

The Laravel Framework.
https://laravel.com
MIT License
32.21k stars 10.9k forks source link

Signed route fails with additional parameters #24095

Closed francoism90 closed 6 years ago

francoism90 commented 6 years ago

Description:

Using the following signed router will always result into Invalid signature:

Route::middleware('signed')->name('video.')->namespace('Video')->group(function () {
    Route::get('/stream/{video}/{name}', ['uses' => 'StreamController@show', 'as' => 'stream']);
});

URL generating:

return URL::temporarySignedRoute('video.stream', now()->addMinutes(240), [
            'video' => $this->slug,
            'name'  => 'video.mp4',
        ]);

This works fine:

return URL::temporarySignedRoute('video.stream', now()->addMinutes(240), [
            'video' => $this->slug,
            'name'  => 'video',
        ]);

I want to append the extension part so it can be used on Android to open in external device. It is possible the dot (.) isn't parsed correctly?

Steps To Reproduce:

See Description.

tillkruss commented 6 years ago

Can you write a test case to reproduce this?

francoism90 commented 6 years ago

@tillkruss Sorry for the noise! After some searching it turns out I've had a nginx rule set that replaced headers on some extensions, causing the Invalid signature error.