mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
Merge pull request #152 from utopia-php/fix-kebab-case-site
This commit is contained in:
1 file changed
+19
-11
@@ -1471,7 +1471,7 @@ class Appwrite extends Source
|
||||
// Get the file size
|
||||
$fileSize = $file->getSize();
|
||||
|
||||
if ($end > $fileSize) {
|
||||
if ($end >= $fileSize) {
|
||||
$end = $fileSize - 1;
|
||||
}
|
||||
|
||||
@@ -1495,7 +1495,7 @@ class Appwrite extends Source
|
||||
$start += Transfer::STORAGE_MAX_CHUNK_SIZE;
|
||||
$end += Transfer::STORAGE_MAX_CHUNK_SIZE;
|
||||
|
||||
if ($end > $fileSize) {
|
||||
if ($end >= $fileSize) {
|
||||
$end = $fileSize - 1;
|
||||
}
|
||||
}
|
||||
@@ -1704,8 +1704,8 @@ class Appwrite extends Source
|
||||
$responseHeaders
|
||||
);
|
||||
|
||||
// Content-Length header was missing, file is less than max buffer size.
|
||||
if (!array_key_exists('Content-Length', $responseHeaders)) {
|
||||
// content-length header missing, file is less than max buffer size
|
||||
if (!array_key_exists('content-length', $responseHeaders)) {
|
||||
$file = $this->call(
|
||||
'GET',
|
||||
"/functions/{$func->getId()}/deployments/{$deployment['$id']}/download",
|
||||
@@ -1714,7 +1714,7 @@ class Appwrite extends Source
|
||||
$responseHeaders
|
||||
);
|
||||
|
||||
$size = mb_strlen($file);
|
||||
$size = strlen($file);
|
||||
|
||||
if ($end > $size) {
|
||||
$end = $size - 1;
|
||||
@@ -1737,7 +1737,11 @@ class Appwrite extends Source
|
||||
return;
|
||||
}
|
||||
|
||||
$fileSize = $responseHeaders['Content-Length'];
|
||||
$fileSize = $responseHeaders['content-length'];
|
||||
|
||||
if ($end >= $fileSize) {
|
||||
$end = $fileSize - 1;
|
||||
}
|
||||
|
||||
$deployment = new Deployment(
|
||||
$deployment['$id'],
|
||||
@@ -1772,7 +1776,7 @@ class Appwrite extends Source
|
||||
$start += Transfer::STORAGE_MAX_CHUNK_SIZE;
|
||||
$end += Transfer::STORAGE_MAX_CHUNK_SIZE;
|
||||
|
||||
if ($end > $fileSize) {
|
||||
if ($end >= $fileSize) {
|
||||
$end = $fileSize - 1;
|
||||
}
|
||||
}
|
||||
@@ -1920,7 +1924,7 @@ class Appwrite extends Source
|
||||
$responseHeaders
|
||||
);
|
||||
|
||||
if (!\array_key_exists('Content-Length', $responseHeaders)) {
|
||||
if (!\array_key_exists('content-length', $responseHeaders)) {
|
||||
$file = $this->call(
|
||||
'GET',
|
||||
"/sites/{$site->getId()}/deployments/{$deployment['$id']}/download",
|
||||
@@ -1929,7 +1933,7 @@ class Appwrite extends Source
|
||||
$responseHeaders
|
||||
);
|
||||
|
||||
$size = mb_strlen($file);
|
||||
$size = strlen($file);
|
||||
|
||||
if ($end > $size) {
|
||||
$end = $size - 1;
|
||||
@@ -1951,7 +1955,11 @@ class Appwrite extends Source
|
||||
return;
|
||||
}
|
||||
|
||||
$fileSize = $responseHeaders['Content-Length'];
|
||||
$fileSize = $responseHeaders['content-length'];
|
||||
|
||||
if ($end >= $fileSize) {
|
||||
$end = $fileSize - 1;
|
||||
}
|
||||
|
||||
$siteDeployment = new SiteDeployment(
|
||||
$deployment['$id'],
|
||||
@@ -1982,7 +1990,7 @@ class Appwrite extends Source
|
||||
$start += Transfer::STORAGE_MAX_CHUNK_SIZE;
|
||||
$end += Transfer::STORAGE_MAX_CHUNK_SIZE;
|
||||
|
||||
if ($end > $fileSize) {
|
||||
if ($end >= $fileSize) {
|
||||
$end = $fileSize - 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user