Merge pull request #14827 from fe80/fix/controller-signature-s3

fix(ActionlogController): correct signature image for s3 bucket
This commit is contained in:
snipe 2024-06-05 09:40:21 +01:00 committed by GitHub
commit a742105c21
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -14,6 +14,12 @@ class ActionlogController extends Controller
// file_get_contents, so we set the error reporting for just this class
error_reporting(0);
$disk = config('filesystems.default');
switch (config("filesystems.disks.$disk.driver")) {
case 's3':
$file = 'private_uploads/signatures/'.$filename;
return redirect()->away(Storage::disk($disk)->temporaryUrl($file, now()->addMinutes(5)));
default:
$this->authorize('view', \App\Models\Asset::class);
$file = config('app.private_uploads').'/signatures/'.$filename;
$filetype = Helper::checkUploadIsImage($file);
@ -25,7 +31,6 @@ class ActionlogController extends Controller
} else {
return Response::make($contents)->header('Content-Type', $filetype);
}
}
public function getStoredEula($filename){
$this->authorize('view', \App\Models\Asset::class);