Merge pull request #33391 from nextcloud/backport/33280/stable24

[stable24] handle AccessDenied error when checking if external s3 support versions
This commit is contained in:
blizzz 2022-08-01 15:10:36 +02:00 committed by GitHub
commit 66d4f6744e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;