]> source.dussan.org Git - nextcloud-server.git/commitdiff
always set Key field in `headObject`
authorRobin Appelman <robin@icewind.nl>
Fri, 15 Oct 2021 14:23:39 +0000 (16:23 +0200)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Fri, 22 Oct 2021 12:34:31 +0000 (12:34 +0000)
Signed-off-by: Robin Appelman <robin@icewind.nl>
apps/files_external/lib/Lib/Storage/AmazonS3.php

index 527a87aeb9a2b285b3501009a219f141b247e432..aa0afac15439faecc3a70bc950369c53be6359e0 100644 (file)
@@ -154,6 +154,9 @@ class AmazonS3 extends \OC\Files\Storage\Common {
                        }
                }
 
+               if (is_array($this->objectCache[$key]) && !isset($this->objectCache[$key]["Key"])) {
+                       $this->objectCache[$key]["Key"] = $key;
+               }
                return $this->objectCache[$key];
        }
 
@@ -345,7 +348,6 @@ class AmazonS3 extends \OC\Files\Storage\Common {
                        if ($object === false) {
                                return false;
                        }
-                       $object["Key"] = $path;
                        $stat = $this->objectToMetaData($object);
                }
                $stat['atime'] = time();