Skip to content

Commit d32cae3

Browse files
Merge pull request #58840 from nextcloud/jtr/fix-ObjectStore-S3-doesObjectExistV2
fix(ObjectStore/S3): switch to more reliable doesObjectExistV2
2 parents 12e8019 + 1989ae9 commit d32cae3

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/private/Files/ObjectStore/S3ObjectTrait.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Aws\Command;
1010
use Aws\Exception\AwsException;
1111
use Aws\Exception\MultipartUploadException;
12+
use Aws\S3\Exception\S3Exception;
1213
use Aws\S3\Exception\S3MultipartUploadException;
1314
use Aws\S3\MultipartCopy;
1415
use Aws\S3\MultipartUploader;
@@ -267,8 +268,11 @@ public function deleteObject($urn) {
267268
]);
268269
}
269270

271+
/**
272+
* @throws S3Exception|\Exception if there is an unhandled exception
273+
*/
270274
public function objectExists($urn) {
271-
return $this->getConnection()->doesObjectExist($this->bucket, $urn, $this->getServerSideEncryptionParameters());
275+
return $this->getConnection()->doesObjectExistV2($this->bucket, $urn, false, $this->getServerSideEncryptionParameters());
272276
}
273277

274278
public function copyObject($from, $to, array $options = []) {

0 commit comments

Comments
 (0)