From 818917c3fa04538caaed4e4906684b915801cb29 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Julius=20H=C3=A4rtl?= Date: Thu, 13 Aug 2020 15:26:42 +0200 Subject: [PATCH] Return proper status when file didn't exist before MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- apps/dav/lib/Upload/ChunkingPlugin.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/dav/lib/Upload/ChunkingPlugin.php b/apps/dav/lib/Upload/ChunkingPlugin.php index 74892aaffde..631111ad128 100644 --- a/apps/dav/lib/Upload/ChunkingPlugin.php +++ b/apps/dav/lib/Upload/ChunkingPlugin.php @@ -69,6 +69,7 @@ class ChunkingPlugin extends ServerPlugin { * @return bool|void false to stop handling, void to skip this handler */ public function performMove($path, $destination) { + $fileExists = $this->server->tree->nodeExists($destination); // do a move manually, skipping Sabre's default "delete" for existing nodes try { $this->server->tree->move($path, $destination); @@ -87,7 +88,7 @@ class ChunkingPlugin extends ServerPlugin { $response = $this->server->httpResponse; $response->setHeader('Content-Length', '0'); - $response->setStatus(204); + $response->setStatus($fileExists ? 204 : 201); return false; } -- 2.39.5