]> source.dussan.org Git - nextcloud-server.git/commitdiff
Return correct status if touch failed 41062/head
authorLouis Chemineau <louis@chmn.me>
Mon, 23 Oct 2023 13:26:43 +0000 (15:26 +0200)
committerLouis Chemineau <louis@chmn.me>
Mon, 23 Oct 2023 13:26:43 +0000 (15:26 +0200)
Signed-off-by: Louis Chemineau <louis@chmn.me>
apps/files_external/lib/Lib/Storage/AmazonS3.php

index e9398815055bdf45a24d5e22ddd264ffe20ce1eb..8e2a6b8ea12e3d04ea7f31cecdb7873a18528e3f 100644 (file)
@@ -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',