diff options
author | Julius Härtl <jus@bitgrid.net> | 2020-09-09 15:19:04 +0200 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2020-09-10 13:14:41 +0000 |
commit | 2e3539863e1050b15d15c2c4f8f9dff1c26045ce (patch) | |
tree | 5636f6d9c02aa20e52e498813fd2c0eeb50cf97a | |
parent | 4163ee97ef66e357c5ff15ce1a680dffdbdd9340 (diff) | |
download | nextcloud-server-2e3539863e1050b15d15c2c4f8f9dff1c26045ce.tar.gz nextcloud-server-2e3539863e1050b15d15c2c4f8f9dff1c26045ce.zip |
Set delimiter so that the CommonPrefixes response can properly be determined
Signed-off-by: Julius Härtl <jus@bitgrid.net>
-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 9a3697424fd..0e9c4ebc120 100644 --- a/apps/files_external/lib/Lib/Storage/AmazonS3.php +++ b/apps/files_external/lib/Lib/Storage/AmazonS3.php @@ -161,8 +161,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; |