From da4712b62c3625f43110d4ffbb8524a7b2b318ab Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 19 Oct 2021 14:58:40 +0200 Subject: [PATCH] minor directory detect improvements Signed-off-by: Robin Appelman --- apps/files_external/lib/Lib/Storage/AmazonS3.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/files_external/lib/Lib/Storage/AmazonS3.php b/apps/files_external/lib/Lib/Storage/AmazonS3.php index aa0afac1543..cb5fe134e6f 100644 --- a/apps/files_external/lib/Lib/Storage/AmazonS3.php +++ b/apps/files_external/lib/Lib/Storage/AmazonS3.php @@ -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)) {