Set delimiter so that the CommonPrefixes response can properly be determined
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
fc96fa0cc7
commit
2004ae4603
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue