mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
fix: lint error
This commit is contained in:
@@ -1121,12 +1121,12 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview')
|
||||
|
||||
$contentType = (\array_key_exists($output, $outputs)) ? $outputs[$output] : $outputs['jpg'];
|
||||
|
||||
// Update transformedAt only when image transformations are allowed
|
||||
// Do not count Console/privileged requests — we only want to record
|
||||
// transformedAt for actual API uses.
|
||||
$allowImageTransformations = $bucket->getAttribute('imageTransformations', true);
|
||||
$isPrivilegedUser = Auth::isPrivilegedUser(Authorization::getRoles());
|
||||
if ($allowImageTransformations && !$isPrivilegedUser) {
|
||||
// Update transformedAt only when image transformations are allowed
|
||||
// Do not count Console/privileged requests — we only want to record
|
||||
// transformedAt for actual API uses.
|
||||
$allowImageTransformations = $bucket->getAttribute('imageTransformations', true);
|
||||
$isPrivilegedUser = Auth::isPrivilegedUser(Authorization::getRoles());
|
||||
if ($allowImageTransformations && !$isPrivilegedUser) {
|
||||
$transformedAt = $file->getAttribute('transformedAt', '');
|
||||
if (DateTime::formatTz(DateTime::addSeconds(new \DateTime(), -APP_PROJECT_ACCESS)) > $transformedAt) {
|
||||
$file->setAttribute('transformedAt', DateTime::now());
|
||||
|
||||
@@ -1508,4 +1508,4 @@ class StorageCustomClientTest extends Scope
|
||||
|
||||
$this->assertEquals(401, $previewKey2['headers']['status-code']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user