Merge pull request #58840 from nextcloud/jtr/fix-ObjectStore-S3-doesObjectExistV2

fix(ObjectStore/S3): switch to more reliable doesObjectExistV2
This commit is contained in:
Josh 2026-04-29 08:48:53 -04:00 committed by GitHub
commit d32cae3e68
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -9,6 +9,7 @@ namespace OC\Files\ObjectStore;
use Aws\Command;
use Aws\Exception\AwsException;
use Aws\Exception\MultipartUploadException;
use Aws\S3\Exception\S3Exception;
use Aws\S3\Exception\S3MultipartUploadException;
use Aws\S3\MultipartCopy;
use Aws\S3\MultipartUploader;
@ -267,8 +268,11 @@ trait S3ObjectTrait {
]);
}
/**
* @throws S3Exception|\Exception if there is an unhandled exception
*/
public function objectExists($urn) {
return $this->getConnection()->doesObjectExist($this->bucket, $urn, $this->getServerSideEncryptionParameters());
return $this->getConnection()->doesObjectExistV2($this->bucket, $urn, false, $this->getServerSideEncryptionParameters());
}
public function copyObject($from, $to, array $options = []) {