Skip to content
Prev Previous commit
Next Next commit
minor directory detect improvements
Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 authored and backportbot[bot] committed Oct 22, 2021
commit da4712b62c3625f43110d4ffbb8524a7b2b318ab
4 changes: 2 additions & 2 deletions apps/files_external/lib/Lib/Storage/AmazonS3.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ private function doesDirectoryExist($path) {
return true;
}
} catch (S3Exception $e) {
if ($e->getStatusCode() === 403) {
if ($e->getStatusCode() >= 400 && $e->getStatusCode() < 500) {
$this->directoryCache[$path] = false;
}
throw $e;
Expand Down Expand Up @@ -422,7 +422,7 @@ public function filetype($path) {
}

try {
if (isset($this->directoryCache[$path])) {
if (isset($this->directoryCache[$path]) && $this->directoryCache[$path]) {
return 'dir';
}
if (isset($this->filesCache[$path]) || $this->headObject($path)) {
Expand Down