Merge pull request #38167 from nextcloud/backport/38100/stable26

[stable26] Fix error on delete in ChunkingV2Plugin
This commit is contained in:
Arthur Schiwon 2023-05-17 15:54:52 +02:00 committed by GitHub
commit 83e0b31b62
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -255,17 +255,15 @@ class ChunkingV2Plugin extends ServerPlugin {
public function beforeDelete(RequestInterface $request, ResponseInterface $response) {
try {
$this->prepareUpload($request->getPath());
if (!$this->uploadFolder instanceof UploadFolder) {
return true;
}
[$storage, $storagePath] = $this->getUploadStorage($this->uploadPath);
$storage->cancelChunkedWrite($storagePath, $this->uploadId);
return true;
} catch (NotFound $e) {
$this->prepareUpload(dirname($request->getPath()));
$this->checkPrerequisites();
} catch (StorageInvalidException|BadRequest|NotFound $e) {
return true;
}
[$storage, $storagePath] = $this->getUploadStorage($this->uploadPath);
$storage->cancelChunkedWrite($storagePath, $this->uploadId);
return true;
}
/**