mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 08:58:35 +00:00
Fix: unlimited deployment size
This commit is contained in:
parent
4adea70684
commit
b4f5af8461
3 changed files with 4 additions and 4 deletions
|
|
@ -182,7 +182,7 @@ class Create extends Action
|
|||
}
|
||||
}
|
||||
|
||||
if (!$fileSizeValidator->isValid($fileSize)) { // Check if file size is exceeding allowed limit
|
||||
if (!$fileSizeValidator->isValid($fileSize) && $functionSizeLimit !== 0) { // Check if file size is exceeding allowed limit
|
||||
throw new Exception(Exception::STORAGE_INVALID_FILE_SIZE);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -486,7 +486,7 @@ class Builds extends Action
|
|||
$sizeLimit = (int) $plan['deploymentSize'] * 1000 * 1000;
|
||||
}
|
||||
|
||||
if ($directorySize > $sizeLimit) {
|
||||
if ($directorySize > $sizeLimit && $sizeLimit !== 0) {
|
||||
throw new \Exception('Repository directory size should be less than ' . number_format($sizeLimit / (1000 * 1000), 2) . ' MBs.');
|
||||
}
|
||||
|
||||
|
|
@ -816,7 +816,7 @@ class Builds extends Action
|
|||
if (isset($plan['buildSize'])) {
|
||||
$buildSizeLimit = $plan['buildSize'] * 1000 * 1000;
|
||||
}
|
||||
if ($response['size'] > $buildSizeLimit) {
|
||||
if ($response['size'] > $buildSizeLimit && $buildSizeLimit !== 0) {
|
||||
throw new \Exception('Build size should be less than ' . number_format($buildSizeLimit / (1000 * 1000), 2) . ' MBs.');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ class Create extends Action
|
|||
}
|
||||
}
|
||||
|
||||
if (!$fileSizeValidator->isValid($fileSize)) { // Check if file size is exceeding allowed limit
|
||||
if (!$fileSizeValidator->isValid($fileSize) && $siteSizeLimit !== 0) { // Check if file size is exceeding allowed limit
|
||||
throw new Exception(Exception::STORAGE_INVALID_FILE_SIZE);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue