summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLorenzo Tanganelli <35271287+tanganellilore@users.noreply.github.com>2023-05-05 12:56:55 +0000
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2023-05-10 06:51:51 +0000
commit4944975a1429d87e48730cd354f5b35e7f137971 (patch)
tree236e82445ac08a073777991580624460c6227bb8
parent1229beb55cafd3f6ef7e32f9b3ae6b1837fc2de7 (diff)
downloadnextcloud-server-4944975a1429d87e48730cd354f5b35e7f137971.tar.gz
nextcloud-server-4944975a1429d87e48730cd354f5b35e7f137971.zip
fix error on delete in ChunkingV2Plugin
Signed-off-by: Lorenzo Tanganelli <lorenzo.tanganelli@hotmail.it>
-rw-r--r--apps/dav/lib/Upload/ChunkingV2Plugin.php16
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;
}
/**