diff options
author | Lorenzo Tanganelli <35271287+tanganellilore@users.noreply.github.com> | 2023-05-05 12:56:55 +0000 |
---|---|---|
committer | Lorenzo Tanganelli <lorenzo.tanganelli@hotmail.it> | 2023-05-05 13:07:58 +0000 |
commit | d920e65dc5faa07a27afadfc3666f11f679c9f4a (patch) | |
tree | 680084935dd0900347c6be73be6f6e999a447ead /apps | |
parent | 263a6910c41c07614e2a40349f2ae23e2fca0cb9 (diff) | |
download | nextcloud-server-d920e65dc5faa07a27afadfc3666f11f679c9f4a.tar.gz nextcloud-server-d920e65dc5faa07a27afadfc3666f11f679c9f4a.zip |
fix error on delete in ChunkingV2Plugin
Signed-off-by: Lorenzo Tanganelli <lorenzo.tanganelli@hotmail.it>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dav/lib/Upload/ChunkingV2Plugin.php | 16 |
1 files 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; } /** |