Skip to content

Commit 4adf3b4

Browse files
committed
fixup
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent 4e3f9f4 commit 4adf3b4

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

apps/files_external/lib/Lib/Storage/AmazonS3.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,16 @@ private function invalidateCache(string $key): void {
111111
private function headObject(string $key): array|false {
112112
if (!isset($this->objectCache[$key])) {
113113
try {
114-
$this->objectCache[$key] = $this->getConnection()->headObject([
114+
$result = $this->getConnection()->headObject([
115115
'Bucket' => $this->bucket,
116116
'Key' => $key
117117
] + $this->getSSECParameters())->toArray();
118+
119+
if ($result->hasKey('x-amz-delete-marker')) {
120+
$this->objectCache[$key] = false;
121+
} else {
122+
$this->objectCache[$key] = $result;
123+
}
118124
} catch (S3Exception $e) {
119125
if ($e->getStatusCode() >= 500) {
120126
throw $e;

0 commit comments

Comments
 (0)