]> source.dussan.org Git - nextcloud-server.git/commitdiff
minor directory detect improvements
authorRobin Appelman <robin@icewind.nl>
Tue, 19 Oct 2021 12:58:40 +0000 (14:58 +0200)
committerRobin Appelman <robin@icewind.nl>
Tue, 26 Oct 2021 12:45:20 +0000 (14:45 +0200)
Signed-off-by: Robin Appelman <robin@icewind.nl>
apps/files_external/lib/Lib/Storage/AmazonS3.php

index ee9d35847f1339cd03fec24e230750585d04a13a..64da89c12f2d7959376c92efcf9b5f41c21094e4 100644 (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)) {