Fixes for proteted downloads
This commit is contained in:
parent
18ca64c72c
commit
40a16226eb
|
|
@ -29,8 +29,10 @@ class ProtectedDownloadController extends BaseController
|
|||
throw new SystemError('File no longer available', 404);
|
||||
abort(404, 'File no longer available');
|
||||
}
|
||||
|
||||
return response()->download($hashed_path, basename($hashed_path), [])->deleteFileAfterSend(true);
|
||||
|
||||
return response()->streamDownload(function () use ($hashed_path) {
|
||||
echo Storage::get($hashed_path);
|
||||
}, basename($hashed_path), []);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -406,6 +406,6 @@ Route::post('api/v1/yodlee/data_updates', [YodleeController::class, 'dataUpdates
|
|||
Route::post('api/v1/yodlee/refresh_updates', [YodleeController::class, 'refreshUpdatesWebhook'])->middleware('throttle:100,1');
|
||||
Route::post('api/v1/yodlee/balance', [YodleeController::class, 'balanceWebhook'])->middleware('throttle:100,1');
|
||||
|
||||
Route::get('api/v1/protected_download/{hash}', [ProtectedDownloadController::class, 'index'])->name('protected_download')->middleware('signed')->middleware('throttle:300,1');
|
||||
Route::get('api/v1/protected_download/{hash}', [ProtectedDownloadController::class, 'index'])->name('protected_download')->middleware('throttle:300,1');
|
||||
|
||||
Route::fallback([BaseController::class, 'notFound'])->middleware('throttle:404');
|
||||
Loading…
Reference in New Issue