mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
improve get file token
This commit is contained in:
@@ -1680,7 +1680,13 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId')
|
||||
throw new Exception(Exception::STORAGE_FILE_NOT_FOUND);
|
||||
}
|
||||
|
||||
$response->dynamic($file, Response::MODEL_FILE_TOKEN);
|
||||
$token = $dbForProject->getDocument('fileTokens', $tokenId);
|
||||
|
||||
if($token->isEmpty() || $token->getAttribute('bucketInternalId') != $bucket->getInternalId() || $token->getAttribute('fileInternalId') != $file->getInternalId()) {
|
||||
throw new Exception(Exception::STORAGE_FILE_TOKEN_NOT_FOUND);
|
||||
}
|
||||
|
||||
$response->dynamic($token, Response::MODEL_FILE_TOKEN);
|
||||
});
|
||||
|
||||
App::put('/v1/storage/buckets/:bucketId/files/:fileId/tokens/:tokenId')
|
||||
|
||||
Reference in New Issue
Block a user