lundi 22 juillet 2019

Temporary Signed URL Returning False With Signed URL and Filename

I know currently that laravel doesnt support temporary download urls for local storage. I thought that if I could used a temporary signed url with the filename in it, that would work. But I think it doesnt work either as I keep get a false returned when verifying the signed url. If I remove the filename variable from the route, it works without issues.

Route::get('/download/{filename}', function ($filename, Request $request) {
    dd($request->
})->name('download');

Route::get('/test', function () {
    return URL::temporarySignedRoute('download', now()->addMinutes(40), ['filename', 'HH_test_1G.zip']);
});

This returns something like

http://gamedev.test/download/filename?expires=1563856292&signature=dee882c87a145e587118b4980ef8ad1f09a4fdb691cf8dd9953b6e44adafe4aa&HH_test_1G.zip

When I do $request->hasValidSignature(), it returns false. Without the filename variable, it works fine and returns true.

I am thinking this is might be an ID 10 T error on my part.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire