summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2023-05-17 15:54:52 +0200
committerGitHub <noreply@github.com>2023-05-17 15:54:52 +0200
commit83e0b31b6207ca945ea344d702a6befd11595aed (patch)
tree86fabead70d8b6b98bb4d58ff9ad858e30179a24
parentd1640ac7585049d3f6ed03471dcbee944fce674d (diff)
parent4944975a1429d87e48730cd354f5b35e7f137971 (diff)
downloadnextcloud-server-83e0b31b6207ca945ea344d702a6befd11595aed.tar.gz
nextcloud-server-83e0b31b6207ca945ea344d702a6befd11595aed.zip
Merge pull request #38167 from nextcloud/backport/38100/stable26
[stable26] Fix error on delete in ChunkingV2Plugin
-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;
}
/**