Merge pull request #33280 from nextcloud/externalStorageWithoutVersioning

handle AccessDenied error when checking if external s3 support versions
pull/33396/head
Vincent Petry 2022-07-28 12:13:43 +07:00 committed by GitHub
commit a1bf9b9757
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

@ -744,7 +744,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;