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
30ea77c673
commit
b946d2c444
|
@ -162,8 +162,9 @@ class AmazonS3 extends \OC\Files\Storage\Common {
|
||||||
'Bucket' => $this->bucket,
|
'Bucket' => $this->bucket,
|
||||||
'Prefix' => rtrim($path, '/'),
|
'Prefix' => rtrim($path, '/'),
|
||||||
'MaxKeys' => 1,
|
'MaxKeys' => 1,
|
||||||
|
'Delimiter' => '/',
|
||||||
]);
|
]);
|
||||||
$this->directoryCache[$path] = $result['Contents'] || $result['CommonPrefixes'];
|
$this->directoryCache[$path] = ($result['Contents'][0]['Key'] === rtrim($path, '/') . '/') || $result['CommonPrefixes'];
|
||||||
} catch (S3Exception $e) {
|
} catch (S3Exception $e) {
|
||||||
if ($e->getStatusCode() === 403) {
|
if ($e->getStatusCode() === 403) {
|
||||||
$this->directoryCache[$path] = false;
|
$this->directoryCache[$path] = false;
|
||||||
|
|
Loading…
Reference in New Issue