aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2020-09-09 15:19:04 +0200
committerJulius Härtl <jus@bitgrid.net>2020-09-10 08:11:55 +0200
commit2004ae46030734080fa2fcf73ec54a3893333408 (patch)
treef8f692b3eacd7360c957a81aa07cbe49b54978a7 /apps/files_external/lib
parentfc96fa0cc7081307a8c03457a026fdc045d88f02 (diff)
downloadnextcloud-server-2004ae46030734080fa2fcf73ec54a3893333408.tar.gz
nextcloud-server-2004ae46030734080fa2fcf73ec54a3893333408.zip
Set delimiter so that the CommonPrefixes response can properly be determined
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/files_external/lib')
-rw-r--r--apps/files_external/lib/Lib/Storage/AmazonS3.php3
1 files changed, 2 insertions, 1 deletions
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;