From: Julius Härtl Date: Wed, 9 Sep 2020 13:19:04 +0000 (+0200) Subject: Set delimiter so that the CommonPrefixes response can properly be determined X-Git-Tag: v20.0.0beta4~13^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2004ae46030734080fa2fcf73ec54a3893333408;p=nextcloud-server.git Set delimiter so that the CommonPrefixes response can properly be determined Signed-off-by: Julius Härtl --- diff --git a/apps/files_external/lib/Lib/Storage/AmazonS3.php b/apps/files_external/lib/Lib/Storage/AmazonS3.php index dc725188979..4510de8b6ec 100644 --- a/apps/files_external/lib/Lib/Storage/AmazonS3.php +++ b/apps/files_external/lib/Lib/Storage/AmazonS3.php @@ -163,8 +163,9 @@ class AmazonS3 extends \OC\Files\Storage\Common { 'Bucket' => $this->bucket, 'Prefix' => rtrim($path, '/'), 'MaxKeys' => 1, + 'Delimiter' => '/', ]); - $this->directoryCache[$path] = $result['Contents'] || $result['CommonPrefixes']; + $this->directoryCache[$path] = ($result['Contents'][0]['Key'] === rtrim($path, '/') . '/') || $result['CommonPrefixes']; } catch (S3Exception $e) { if ($e->getStatusCode() === 403) { $this->directoryCache[$path] = false;