From 4944975a1429d87e48730cd354f5b35e7f137971 Mon Sep 17 00:00:00 2001 From: Lorenzo Tanganelli <35271287+tanganellilore@users.noreply.github.com> Date: Fri, 5 May 2023 12:56:55 +0000 Subject: [PATCH] fix error on delete in ChunkingV2Plugin Signed-off-by: Lorenzo Tanganelli --- apps/dav/lib/Upload/ChunkingV2Plugin.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/apps/dav/lib/Upload/ChunkingV2Plugin.php b/apps/dav/lib/Upload/ChunkingV2Plugin.php index cb7c802125c..6b660fb7c6f 100644 --- a/apps/dav/lib/Upload/ChunkingV2Plugin.php +++ b/apps/dav/lib/Upload/ChunkingV2Plugin.php @@ -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; } /** -- 2.39.5