From 30fdb9f66dc7ce3e1d8b05c7bf0ad9c4175c08db Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 16 Jan 2022 13:01:06 +0545 Subject: [PATCH] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Matej Bačo --- app/config/variables.php | 4 ++-- app/controllers/api/functions.php | 4 ++-- docs/references/storage/create-file.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/config/variables.php b/app/config/variables.php index 4557cfbd2e..674487b735 100644 --- a/app/config/variables.php +++ b/app/config/variables.php @@ -470,7 +470,7 @@ return [ ], [ 'name' => '_APP_STORAGE_DEVICE_DO_SPACES_SECRET', - 'description' => 'DigitalOcean spaces secret key. Required when the storage adapter is set to DoSpaces. You can get your secret key from your DigitalOcean console..', + 'description' => 'DigitalOcean spaces secret key. Required when the storage adapter is set to DoSpaces. You can get your secret key from your DigitalOcean console.', 'introduction' => '0.13.0', 'default' => '', 'required' => true, @@ -478,7 +478,7 @@ return [ ], [ 'name' => '_APP_STORAGE_DEVICE_DO_SPACES_REGION', - 'description' => 'DigitalOcean spaces region. Required when storage adapter is set to DoSpaces. You can find your region info for your space from DigitalOcean console..', + 'description' => 'DigitalOcean spaces region. Required when storage adapter is set to DoSpaces. You can find your region info for your space from DigitalOcean console.', 'introduction' => '0.13.0', 'default' => 'us-eas-1', 'required' => false, diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 19d0288e36..42c840476a 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -500,7 +500,7 @@ App::post('/v1/functions/:functionId/tags') throw new Exception('Invalid content-range header', 400); } - if ($end == $fileSize) { + if ($end === $fileSize) { //if it's a last chunks the chunk size might differ, so we set the $chunks and $chunk to notify it's last chunk $chunks = $chunk = -1; } else { @@ -537,7 +537,7 @@ App::post('/v1/functions/:functionId/tags') throw new Exception('Failed moving file', 500); } - if($chunksUploaded == $chunks) { + if($chunksUploaded === $chunks) { $fileSize = $deviceFunctions->getFileSize($path); if ($tag->isEmpty()) { diff --git a/docs/references/storage/create-file.md b/docs/references/storage/create-file.md index c52a7c4e04..25880fdb0f 100644 --- a/docs/references/storage/create-file.md +++ b/docs/references/storage/create-file.md @@ -4,4 +4,4 @@ Larger files should be uploaded using multiple requests with the [content-range] When the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-appwrite-upload-id` header to allow the server to know that the partial upload is for the existing file and not for a new one. -If you're creating a new file using one the Appwrite SDKs, all the chunking logic will be managed by the SDK internally. +If you're creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.