From 46167121fc49704f7566fc9aa7d168079c860d0c Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Tue, 19 Jul 2022 16:20:44 +0200 Subject: [PATCH] handle AccessDenied error when checking if external s3 support versions Signed-off-by: Matthieu Gallien --- apps/files_external/lib/Lib/Storage/AmazonS3.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/files_external/lib/Lib/Storage/AmazonS3.php b/apps/files_external/lib/Lib/Storage/AmazonS3.php index cfd78689fa4..62bff08895b 100644 --- a/apps/files_external/lib/Lib/Storage/AmazonS3.php +++ b/apps/files_external/lib/Lib/Storage/AmazonS3.php @@ -747,7 +747,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { return $result->get('Status') === 'Enabled'; } catch (S3Exception $s3Exception) { // This is needed for compatibility with Storj gateway which does not support versioning yet - if ($s3Exception->getAwsErrorCode() === 'NotImplemented') { + if ($s3Exception->getAwsErrorCode() === 'NotImplemented' || $s3Exception->getAwsErrorCode() === 'AccessDenied') { return false; } throw $s3Exception; -- 2.39.5