diff options
author | Julius Härtl <jus@bitgrid.net> | 2020-09-09 15:19:04 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2020-09-10 08:11:55 +0200 |
commit | 2004ae46030734080fa2fcf73ec54a3893333408 (patch) | |
tree | f8f692b3eacd7360c957a81aa07cbe49b54978a7 /apps/files_external/lib | |
parent | fc96fa0cc7081307a8c03457a026fdc045d88f02 (diff) | |
download | nextcloud-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.php | 3 |
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; |