summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/Upload/ChunkingPlugin.php
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2020-08-13 15:26:42 +0200
committerJulius Härtl <jus@bitgrid.net>2020-08-13 15:26:42 +0200
commit6722246aca71e392ab54600a3c91750075a595f2 (patch)
treed85959431cf09e8a5e3f30ad8dcdd97395ceefc4 /apps/dav/lib/Upload/ChunkingPlugin.php
parentcda5cfc01ea93244dbb1ea93a207d0933b6ba6db (diff)
downloadnextcloud-server-6722246aca71e392ab54600a3c91750075a595f2.tar.gz
nextcloud-server-6722246aca71e392ab54600a3c91750075a595f2.zip
Return proper status when file didn't exist before
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/dav/lib/Upload/ChunkingPlugin.php')
-rw-r--r--apps/dav/lib/Upload/ChunkingPlugin.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/dav/lib/Upload/ChunkingPlugin.php b/apps/dav/lib/Upload/ChunkingPlugin.php
index d9b4ee44d39..6dd05c24ebf 100644
--- a/apps/dav/lib/Upload/ChunkingPlugin.php
+++ b/apps/dav/lib/Upload/ChunkingPlugin.php
@@ -88,6 +88,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);
@@ -106,7 +107,7 @@ class ChunkingPlugin extends ServerPlugin {
$response = $this->server->httpResponse;
$response->setHeader('Content-Length', '0');
- $response->setStatus(204);
+ $response->setStatus($fileExists ? 204 : 201);
return false;
}