minor directory detect improvements

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2021-10-19 14:58:40 +02:00 committed by backportbot[bot]
parent d85c0f0c73
commit da4712b62c

View file

@ -204,7 +204,7 @@ class AmazonS3 extends \OC\Files\Storage\Common {
return true;
}
} catch (S3Exception $e) {
if ($e->getStatusCode() === 403) {
if ($e->getStatusCode() >= 400 && $e->getStatusCode() < 500) {
$this->directoryCache[$path] = false;
}
throw $e;
@ -422,7 +422,7 @@ class AmazonS3 extends \OC\Files\Storage\Common {
}
try {
if (isset($this->directoryCache[$path])) {
if (isset($this->directoryCache[$path]) && $this->directoryCache[$path]) {
return 'dir';
}
if (isset($this->filesCache[$path]) || $this->headObject($path)) {