fix error on delete in ChunkingV2Plugin

Signed-off-by: Lorenzo Tanganelli <lorenzo.tanganelli@hotmail.it>
This commit is contained in:
Lorenzo Tanganelli 2023-05-05 12:56:55 +00:00 committed by Lorenzo Tanganelli
parent 263a6910c4
commit d920e65dc5

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;
}
/**