We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4e3f9f4 commit 4adf3b4Copy full SHA for 4adf3b4
1 file changed
apps/files_external/lib/Lib/Storage/AmazonS3.php
@@ -111,10 +111,16 @@ private function invalidateCache(string $key): void {
111
private function headObject(string $key): array|false {
112
if (!isset($this->objectCache[$key])) {
113
try {
114
- $this->objectCache[$key] = $this->getConnection()->headObject([
+ $result = $this->getConnection()->headObject([
115
'Bucket' => $this->bucket,
116
'Key' => $key
117
] + $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
+ }
124
} catch (S3Exception $e) {
125
if ($e->getStatusCode() >= 500) {
126
throw $e;
0 commit comments