fix preview output when no output param and type doesn't exist

This commit is contained in:
Damodar Lohani
2022-03-13 07:52:00 +00:00
parent 406f914585
commit 935430c3e3
+1 -1
View File
@@ -951,7 +951,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview')
$data = $cache->load($key, 60 * 60 * 24 * 30 * 3/* 3 months */);
if ($data) {
$output = (empty($output)) ? $type : $output;
$output = (empty($output)) ? ( empty($type) ? 'jpg' : $type ) : $output;
return $response
->setContentType((\array_key_exists($output, $outputs)) ? $outputs[$output] : $outputs['jpg'])