diff options
author | Louis <louis@chmn.me> | 2023-10-24 18:08:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-24 18:08:24 +0200 |
commit | c5d82409b47ab6fcda89dfb05b50323345f2fbd7 (patch) | |
tree | 055c5da3990396d71ea7aab917a09760ce83cd34 /apps/files_external | |
parent | efe68d012c354598820121c0ff91dd4db937afdc (diff) | |
parent | e66e8bad1a711ec3073e901e824edc3f92dbd107 (diff) | |
download | nextcloud-server-c5d82409b47ab6fcda89dfb05b50323345f2fbd7.tar.gz nextcloud-server-c5d82409b47ab6fcda89dfb05b50323345f2fbd7.zip |
Merge pull request #41062 from nextcloud/artonge/fix/return_fals_if_touch_fails
Return correct status if touch failed
Diffstat (limited to 'apps/files_external')
-rw-r--r-- | apps/files_external/lib/Lib/Storage/AmazonS3.php | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/apps/files_external/lib/Lib/Storage/AmazonS3.php b/apps/files_external/lib/Lib/Storage/AmazonS3.php index e9398815055..8e2a6b8ea12 100644 --- a/apps/files_external/lib/Lib/Storage/AmazonS3.php +++ b/apps/files_external/lib/Lib/Storage/AmazonS3.php @@ -550,18 +550,20 @@ class AmazonS3 extends \OC\Files\Storage\Common { ]; try { - if (!$this->file_exists($path)) { - $mimeType = $this->mimeDetector->detectPath($path); - $this->getConnection()->putObject([ - 'Bucket' => $this->bucket, - 'Key' => $this->cleanKey($path), - 'Metadata' => $metadata, - 'Body' => '', - 'ContentType' => $mimeType, - 'MetadataDirective' => 'REPLACE', - ]); - $this->testTimeout(); + if ($this->file_exists($path)) { + return false; } + + $mimeType = $this->mimeDetector->detectPath($path); + $this->getConnection()->putObject([ + 'Bucket' => $this->bucket, + 'Key' => $this->cleanKey($path), + 'Metadata' => $metadata, + 'Body' => '', + 'ContentType' => $mimeType, + 'MetadataDirective' => 'REPLACE', + ]); + $this->testTimeout(); } catch (S3Exception $e) { $this->logger->error($e->getMessage(), [ 'app' => 'files_external', |